Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6922

mysqld signal 11 crash when running many ALTER TABLE statements

    XMLWordPrintable

Details

    Description

      I have a migration script that creates several tables, then uses ALTER TABLE to create a bunch of foreign key constraints on those tables. MariaDB 10.0.14 will consistently crash after running between 11 and 14 of ALTER TABLE statements, resulting in err 2006 MySQL server has gone away.

      The same crash appears in MySQL 5.5, which prompted me to try MariaDB, which was working perfectly well in 10.0.13 and then immediately starting exhibiting the same broken behavior when I upgraded to 10.0.14 two days ago.

      After the crash, the following will appear in the error log:

      141023 14:47:57 [ERROR] mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
       
      To report this bug, see http://kb.askmonty.org/en/reporting-bugs
       
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed, 
      something is definitely wrong and this may fail.
       
      Server version: 10.0.14-MariaDB
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=2
      max_threads=153
      thread_count=2
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467142 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x0x7fbcca845808
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x122c50e90 thread_stack 0x48000
      0   mysqld                              0x00000001063a7d9d my_print_stacktrace + 60
      0   mysqld                              0x0000000105e9191d handle_fatal_signal + 602
      0   libsystem_platform.dylib            0x00007fff9415f5aa _sigtramp + 26
      0   ???                                 0x000000010733da00 0x0 + 4415805952
      0   mysqld                              0x000000010625e359 _ZNSt3__16__treeIP14dict_foreign_t20dict_foreign_compareNS_9allocatorIS2_EEE12__find_equalIS2_EER$
      NS_16__tree_node_baseIPvEESC_RKT_ + 53
      0   mysqld                              0x000000010625e2db _ZNSt3__16__treeIP14dict_foreign_t20dict_foreign_compareNS_9allocatorIS2_EEE15__insert_uniqueERKS$
      _ + 33
      0   mysqld                              0x000000010625e55d _ZNK36dict_foreign_add_to_referenced_tableclEP14dict_foreign_t + 37
      0   mysqld                              0x0000000106259515 _Z31dict_create_foreign_constraintsP5trx_tPKcmS2_m + 4599
      0   mysqld                              0x0000000106337d7c _Z33row_table_add_foreign_constraintsP5trx_tPKcmS2_m + 97
      0   mysqld                              0x00000001062b06eb _ZN11ha_innobase6createEPKcP5TABLEP14HA_CREATE_INFO + 2915
      0   mysqld                              0x0000000105e97ac6 _ZN7handler9ha_createEPKcP5TABLEP14HA_CREATE_INFO + 136
      0   mysqld                              0x0000000105e9858d _Z15ha_create_tableP3THDPKcS2_S2_P14HA_CREATE_INFOP34st_mysql_const_unsigned_lex_string + 548
      0   mysqld                              0x00000001060724b0 _Z17mysql_alter_tableP3THDPcS1_P14HA_CREATE_INFOP10TABLE_LISTP10Alter_infojP8st_orderb + 15119
      0   mysqld                              0x00000001060bba93 _ZN19Sql_cmd_alter_table7executeEP3THD + 789
      0   mysqld                              0x0000000105ff2979 _Z21mysql_execute_commandP3THD + 1109
      0   mysqld                              0x0000000105ff1b25 _Z11mysql_parseP3THDPcjP12Parser_state + 516
      0   mysqld                              0x0000000105fef3a7 _Z16dispatch_command19enum_server_commandP3THDPcj + 1003
      0   mysqld                              0x0000000105ff167c _Z10do_commandP3THD + 231
      0   mysqld                              0x00000001060b7911 _Z24do_handle_one_connectionP3THD + 383
      0   mysqld                              0x00000001060b7785 handle_one_connection + 59
      0   libsystem_pthread.dylib             0x00007fff8e035899 _pthread_body + 138
      0   libsystem_pthread.dylib             0x00007fff8e03572a _pthread_struct_init + 0
      0   libsystem_pthread.dylib             0x00007fff8e039fc9 thread_start + 13
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7fbcca83d820): is an invalid pointer
      Connection ID (thread ID): 3
      Status: NOT_KILLED
       
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_conditio
      n_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,pa
      rtial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_
      cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
       
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.

      It's not really particularly easy for me to upload the exact series of CREATE and ALTER statements, because the migrations are generated programatically. But if required, I could probably find a way to log them out.

      Here is a log of all the statements that run before the crash happens, captured by using SET GLOBAL general_log=1:

      /usr/local/Cellar/mariadb/10.0.14/bin/mysqld, Version: 10.0.14-MariaDB (Homebrew). started with:
      Tcp port: 3306  Unix socket: /tmp/mysql.sock
      Time                 Id Command    Argument
      141024 10:03:50	   19 Quit	
      		   18 Quit	
      141024 10:03:56	   20 Connect	ushahidi@localhost as anonymous on ushahidi
      		   20 Query	SET NAMES utf8
      		   20 Query	SHOW TABLES LIKE 'config'
      		   21 Connect	ushahidi@localhost as anonymous on ushahidi
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'phinxlog'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'phinxlog'
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `phinxlog` (`version` BIGINT(14) NOT NULL, `start_time` TIMESTAMP NOT NULL, `end_time` TIMESTAMP NOT NULL) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	SELECT * FROM phinxlog ORDER BY version ASC
      		   21 Query	SELECT 1
      		   21 Query	SELECT * FROM phinxlog ORDER BY version ASC
      		   21 Query	SELECT 1
      		   21 Query	START TRANSACTION
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `config` (`id` INT(11) NOT NULL AUTO_INCREMENT, `group_name` VARCHAR(50) NOT NULL, `config_key` VARCHAR(50) NOT NULL, `config_value` VARCHAR(255) NOT NULL, `updated` TIMESTAMP NOT NULL, PRIMARY KEY (`id`),  UNIQUE KEY (`group_name`,`config_key`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `contacts` (`id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` INT(11) NULL, `data_provider` VARCHAR(150) NULL, `type` VARCHAR(20) NULL COMMENT 'email, phone, twitter', `contact` VARCHAR(255) NOT NULL, `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`),  KEY (`data_provider`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `forms` (`id` INT(11) NOT NULL AUTO_INCREMENT, `parent_id` INT(11) NULL, `name` VARCHAR(255) NOT NULL, `description` TEXT NOT NULL, `type` VARCHAR(30) NOT NULL DEFAULT 'report' COMMENT 'report, comment, stream', `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `form_attributes` (`id` INT(11) NOT NULL AUTO_INCREMENT, `key` VARCHAR(150) NOT NULL, `label` VARCHAR(150) NOT NULL, `input` VARCHAR(30) NOT NULL DEFAULT 'text' COMMENT 'text, textarea, select, radio, checkbox, file, date, location', `type` VARCHAR(30) NOT NULL DEFAULT 'varchar' COMMENT 'decimal, int, geometry, text, varchar, point', `required` TINYINT(1) NOT NULL DEFAULT 0, `default` VARCHAR(150) NULL, `priority` INT(11) NOT NULL DEFAULT 99, `options` VARCHAR(255) NULL, `cardinality` INT(11) NOT NULL DEFAULT 1 COMMENT 'maximum number of values, 0 for unlimited', PRIMARY KEY (`id`),  UNIQUE KEY (`key`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `form_groups` (`id` INT(11) NOT NULL AUTO_INCREMENT, `form_id` INT(11) NOT NULL, `label` VARCHAR(150) NOT NULL, `priority` INT(11) NOT NULL DEFAULT 99, `icon` VARCHAR(100) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `form_groups_form_attributes` (`form_group_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, PRIMARY KEY (`form_group_id`,`form_attribute_id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `media` (`id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` INT(11) NULL, `mime` VARCHAR(50) NOT NULL, `caption` VARCHAR(255) NOT NULL, `o_filename` VARCHAR(255) NOT NULL, `o_size` INT(11) NOT NULL, `o_width` INT(11) NULL, `o_height` INT(11) NULL, `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `messages` (`id` INT(11) NOT NULL AUTO_INCREMENT, `parent_id` INT(11) NULL COMMENT 'marks messages being replied to', `contact_id` INT(11) NULL, `post_id` INT(11) NULL, `data_provider` VARCHAR(150) NULL, `data_provider_message_id` VARCHAR(255) NULL, `title` VARCHAR(255) NULL, `message` TEXT NOT NULL, `datetime` DATETIME NULL, `type` VARCHAR(20) NULL COMMENT 'email, phone, twitter', `status` VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT 'pending, received, expired, cancelled, failed, sent', `direction` VARCHAR(20) NOT NULL DEFAULT 'incoming' COMMENT 'incoming, outgoing', `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`),  KEY (`data_provider`),  KEY (`type`),  KEY (`status`),  KEY (`direction`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `posts` (`id` INT(11) NOT NULL AUTO_INCREMENT, `parent_id` INT(11) NULL, `form_id` INT(11) NULL, `user_id` INT(11) NULL, `type` VARCHAR(20) NOT NULL DEFAULT 'report' COMMENT 'report, update, revision', `title` VARCHAR(150) NOT NULL, `slug` VARCHAR(150) NULL, `content` TEXT NULL, `status` VARCHAR(20) NOT NULL DEFAULT 'draft' COMMENT 'draft, published, pending', `locale` VARCHAR(5) NOT NULL DEFAULT 'en_US', `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`),  KEY (`type`),  KEY (`status`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `posts_media` (`post_id` INT(11) NOT NULL, `media_id` INT(11) NOT NULL, PRIMARY KEY (`post_id`,`media_id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `posts_sets` (`post_id` INT(11) NOT NULL, `set_id` INT(11) NOT NULL, PRIMARY KEY (`post_id`,`set_id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `posts_tags` (`post_id` INT(11) NOT NULL, `tag_id` INT(11) NOT NULL, PRIMARY KEY (`post_id`,`tag_id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_comments` (`id` INT(11) NOT NULL AUTO_INCREMENT, `parent_id` INT(11) NULL, `post_id` INT(11) NOT NULL, `user_id` INT(11) NULL, `content` TEXT NOT NULL, `status` VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT 'pending, published', `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_datetime` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` DATETIME NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_decimal` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` DECIMAL(12,4) NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_geometry` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` GEOMETRY NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_int` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` INT(11) NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_point` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` POINT NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_text` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` TEXT NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `post_varchar` (`id` INT(11) NOT NULL AUTO_INCREMENT, `post_id` INT(11) NOT NULL, `form_attribute_id` INT(11) NOT NULL, `value` VARCHAR(255) NULL, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      141024 10:03:57	   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `roles` (`name` VARCHAR(50) NOT NULL, `display_name` VARCHAR(50) NOT NULL, `description` VARCHAR(255) NULL, `permissions` VARCHAR(255) NULL, PRIMARY KEY (`name`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `sets` (`id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` INT(11) NULL, `name` VARCHAR(255) NOT NULL, `filter` TEXT NULL, `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `tags` (`id` INT(11) NOT NULL AUTO_INCREMENT, `parent_id` INT(11) NULL, `tag` VARCHAR(50) NOT NULL, `slug` VARCHAR(50) NOT NULL, `type` VARCHAR(20) NOT NULL DEFAULT 'category' COMMENT 'category, status', `color` VARCHAR(6) NULL, `icon` VARCHAR(20) NOT NULL DEFAULT 'tag', `description` TEXT NULL, `role` VARCHAR(255) NULL, `priority` INT(11) NOT NULL DEFAULT 99, `created` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `tasks` (`id` INT(11) NOT NULL AUTO_INCREMENT, `parent_id` INT(11) NULL, `post_id` INT(11) NULL, `assignee` INT(11) NULL, `assignor` INT(11) NULL, `description` VARCHAR(255) NOT NULL, `status` VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT 'pending, complete, later', `due` INT(11) NULL, `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	CREATE TABLE `users` (`id` INT(11) NOT NULL AUTO_INCREMENT, `email` VARCHAR(150) NULL, `realname` VARCHAR(150) NULL, `username` VARCHAR(50) NULL, `password` VARCHAR(255) NULL, `role` VARCHAR(50) NOT NULL DEFAULT 'user', `logins` INT(11) NOT NULL DEFAULT 0, `failed_attempts` INT(11) NOT NULL DEFAULT 0, `last_login` INT(11) NULL, `last_attempt` INT(11) NULL, `created` INT(11) NOT NULL DEFAULT 0, `updated` INT(11) NULL, PRIMARY KEY (`id`),  UNIQUE KEY (`email`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
      		   21 Query	SELECT 1
      		   21 Query	COMMIT
      		   21 Query	SELECT 1
      		   21 Query	INSERT INTO phinxlog (version, start_time, end_time) VALUES ("20140716082651","2014-10-24 15:03:56","2014-10-24 15:03:57")
      		   21 Query	SELECT 1
      		   21 Query	START TRANSACTION
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'contacts'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'contacts'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `contacts` ADD  FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'forms'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'forms'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `forms` ADD  FOREIGN KEY (`parent_id`) REFERENCES `forms` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'form_groups'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'form_groups'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `form_groups` ADD  FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'form_groups_form_attributes'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'form_groups_form_attributes'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `form_groups_form_attributes` ADD  FOREIGN KEY (`form_group_id`) REFERENCES `form_groups` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'form_groups_form_attributes'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'form_groups_form_attributes'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `form_groups_form_attributes` ADD  FOREIGN KEY (`form_attribute_id`) REFERENCES `form_attributes` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'messages'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'messages'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `messages` ADD  FOREIGN KEY (`parent_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts` ADD  FOREIGN KEY (`parent_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts` ADD  FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts` ADD  FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_media'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_media'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts_media` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_media'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_media'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts_media` ADD  FOREIGN KEY (`media_id`) REFERENCES `media` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_sets'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_sets'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts_sets` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_sets'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'posts_sets'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `posts_sets` ADD  FOREIGN KEY (`set_id`) REFERENCES `sets` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_comments'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_comments'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_comments` ADD  FOREIGN KEY (`parent_id`) REFERENCES `post_comments` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_comments'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_comments'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_comments` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_datetime'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_datetime'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_datetime` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_decimal'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_decimal'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_decimal` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_geometry'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_geometry'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_geometry` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_int'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_int'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_int` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_point'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_point'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_point` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_text'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_text'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_text` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_varchar'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_varchar'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_varchar` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'sets'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'sets'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `sets` ADD  FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'tags'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'tags'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `tags` ADD  FOREIGN KEY (`parent_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'tasks'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'tasks'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `tasks` ADD  FOREIGN KEY (`parent_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'media'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'media'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `media` ADD  FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'messages'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'messages'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `messages` ADD  FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'messages'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'messages'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `messages` ADD  FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_comments'
      		   21 Query	SELECT 1
      		   21 Query	SELECT TABLE_NAME
                  FROM INFORMATION_SCHEMA.TABLES
                  WHERE TABLE_SCHEMA = 'ushahidi' AND TABLE_NAME = 'post_comments'
      		   21 Query	SELECT 1
      		   21 Query	ALTER TABLE `post_comments` ADD  FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE

      Attachments

        Issue Links

          Activity

            People

              elenst Elena Stepanova
              shadowhand Woody Gilk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.