Failing assertion: primary_key_no == -1 || primary_key_no == 0 in ha_innobase::create from handler/ha_innodb.cc:8200

Bug #1317852 reported by Ramesh Sivaraman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Unassigned
5.1
Won't Fix
High
Unassigned
5.5
Fix Released
High
Unassigned
5.6
Invalid
Undecided
Unassigned

Bug Description

========================= Error log:
140508 14:52:43 InnoDB: Assertion failure in thread 140643607172864 in file ha_innodb.cc line 8200
InnoDB: Failing assertion: primary_key_no == -1 || primary_key_no == 0
--
--
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fe9f8004c10): ALTER TABLE `table1_innodb_default` MODIFY `c34` TIME
Connection ID (thread ID):

========================= gdb :

+bt
#0 0x00007fea28e7869c in pthread_kill () from /lib64/libpthread.so.0
#1 0x0000000000801876 in my_write_core (sig=6) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/mysys/stacktrace.c:433
#2 0x00000000006c27f9 in handle_fatal_signal (sig=6) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/signal_handler.cc
:250
#3 <signal handler called>
#4 0x00007fea276f28e5 in raise () from /lib64/libc.so.6
#5 0x00007fea276f40c5 in abort () from /lib64/libc.so.6
#6 0x0000000000822e42 in ha_innobase::create (this=<value optimized out>, name=<value optimized out>, form=0x7fea243e6760, create_info=0x7fea243ea3e0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/storage/innobase/handler/ha_innodb.cc:8200
#7 0x00000000006cb87b in handler::ha_create (this=0x7fe9f8255f30, name=0x7fea243e85c0 "./test/#sql-38be_9", form=0x7fea243e6760, info=0x7fea243ea3e0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/handler.cc:3724
#8 0x00000000006cbcba in ha_create_table (thd=0x2fbf2c0, path=0x7fea243e85c0 "./test/#sql-38be_9", db=0x7fe9f80052b8 "test", table_name=0x7fea243ea300 "#sql-38be_9", create_info=0x7fea243ea3e0, update_create_info=false) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/handler.cc:4039
#9 0x000000000063e324 in rea_create_table (thd=0x2fbf2c0, path=0x7fea243e85c0 "./test/#sql-38be_9", db=0x7fe9f80052b8 "test", table_name=0x7fea243ea300 "#sql-38be_9", create_info=0x7fea243ea3e0, create_fields=..., keys=24, key_info=0x7fe9f80a8248, file=0x7fe9f805df70) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/unireg.cc:528
#10 0x000000000060e912 in mysql_create_table_no_lock (thd=0x2fbf2c0, db=0x7fe9f80052b8 "test", table_name=0x7fea243ea300 "#sql-38be_9", create_info=0x7fea243ea3e0, alter_info=0x7fea243ea4c0, internal_tmp_table=155, select_field_count=0, is_trans=0x0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_table.cc:4351
#11 0x000000000061402b in mysql_alter_table (thd=<value optimized out>, new_db=0x7fe9f80052b8 "test", new_name=0x7fe9f8004d10 "table1_innodb_default", create_info=0x7fea243ea3e0, table_list=<value optimized out>, alter_info=0x7fea243ea401, order_num=0, order=0x0, ignore=false) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_table.cc:6639
#12 0x00000000007dfd0a in Alter_table_statement::execute (this=<value optimized out>, thd=0x2fbf2c0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_alter.cc:106
#13 0x00000000005aa35d in mysql_execute_command (thd=0x2fbf2c0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_parse.cc:4681
#14 0x00000000005aacac in mysql_parse (thd=0x2fbf2c0, rawbuf=0x7fe9f8004c10 "ALTER TABLE `table1_innodb_default` MODIFY `c34` TIME", length=<value optimized out>, parser_state=0x7fea243ebed0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_parse.cc:5922
#15 0x00000000005ac447 in dispatch_command (command=COM_QUERY, thd=0x2fbf2c0, packet=<value optimized out>, packet_length=56) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_parse.cc:1079
#16 0x00000000005ae14b in do_command (thd=0x2fbf2c0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_parse.cc:789
#17 0x00000000006594df in do_handle_one_connection (thd_arg=<value optimized out>) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_connect.cc:1409
#18 0x00000000006595de in handle_one_connection (arg=0x2fbf2c0) at /mnt/workspace/percona-server-5.5-nightly-debug-binaries/label_exp/centos6-64/sql/sql_connect.cc:1324
#19 0x00007fea28e73851 in start_thread () from /lib64/libpthread.so.0
#20 0x00007fea277a894d in clone () from /lib64/libc.so.6

========================= version:

Server: 655 <email address hidden>
RQG: 954 <email address hidden>

Tags: upstream
Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :
Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :
Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :
Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :
Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :

Attached core/var/grammar/trail files

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The vardir is missing InnoDB logs.

Please test starting a new instance on the vardir (that has logs), note show create table for table1_innodb_default, execute the crashing ALTER TABLE. Does it crash?

Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :

Executed the crashing ALTER TABLE with new instance and it is crashing again.

=====SQL log

mysql> show create table table1_innodb_default\G
*************************** 1. row ***************************
       Table: table1_innodb_default
Create Table: CREATE TABLE `table1_innodb_default` (
  `c32` bit(1) DEFAULT NULL,
  `c14` timestamp NULL DEFAULT NULL,
  `c19` blob,
  `c4` binary(1) DEFAULT '0',
  `c31` set('a','b','c') DEFAULT NULL,
  `c0` binary(1) DEFAULT NULL,
  `c13` set('a','b','c') DEFAULT NULL,
  `c8` tinyint(4) DEFAULT NULL,
  `c23` int(11) DEFAULT NULL,
  `c11` varchar(5) DEFAULT NULL,
  `c6` tinyint(4) DEFAULT NULL,
  `c9` tinyint(3) unsigned DEFAULT NULL,
  `c33` datetime NOT NULL,
  `c3` char(250) CHARACTER SET utf8 NOT NULL,
  `c7` tinyint(4) DEFAULT NULL,
  `c10` tinyint(3) unsigned DEFAULT NULL,
  `c27` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `c16` varchar(4) DEFAULT NULL,
  `c22` tinyblob NOT NULL,
  `c18` tinyblob,
  `c1` char(250) CHARACTER SET utf8 DEFAULT NULL,
  `c24` tinytext CHARACTER SET utf8,
  `c34` datetime NOT NULL,
  `c12` datetime DEFAULT NULL,
  `c25` set('a','b','c') NOT NULL,
  `c17` tinyint(3) unsigned NOT NULL,
  `c2` char(250) CHARACTER SET utf8 DEFAULT NULL,
  `c29` enum('a','b','c') NOT NULL,
  `c35` datetime NOT NULL,
  `c26` tinytext CHARACTER SET utf8,
  `c15` tinyint(3) unsigned NOT NULL,
  `c21` tinyblob NOT NULL,
  `c28` tinytext CHARACTER SET utf8 NOT NULL,
  `c5` char(250) CHARACTER SET utf8 NOT NULL,
  `c20` tinyblob,
  `c30` datetime DEFAULT NULL,
  UNIQUE KEY `c34` (`c34`),
  UNIQUE KEY `c22` (`c22`(255)),
  UNIQUE KEY `c25` (`c25`),
  UNIQUE KEY `c28` (`c28`(255)),
  UNIQUE KEY `c16` (`c16`),
  UNIQUE KEY `c4` (`c4`),
  UNIQUE KEY `c13` (`c13`),
  UNIQUE KEY `c7` (`c7`),
  UNIQUE KEY `c10` (`c10`),
  UNIQUE KEY `c31` (`c31`),
  UNIQUE KEY `c1` (`c1`),
  UNIQUE KEY `c19` (`c19`(255)),
  KEY `c8` (`c8`),
  KEY `c23` (`c23`),
  KEY `c11` (`c11`),
  KEY `c14` (`c14`),
  KEY `c32` (`c32`),
  KEY `c17` (`c17`),
  KEY `c2` (`c2`),
  KEY `c29` (`c29`),
  KEY `c35` (`c35`),
  KEY `c26` (`c26`(255)),
  KEY `c5` (`c5`),
  KEY `c20` (`c20`(255))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

mysql> ALTER TABLE `table1_innodb_default` MODIFY `c34` TIME;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>

============ Error Log (Attached full log)

140512 9:05:40 InnoDB: Assertion failure in thread 140041435215616 in file ha_innodb.cc line 8200
InnoDB: Failing assertion: primary_key_no == -1 || primary_key_no == 0
--
--
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f5de4004e50): ALTER TABLE `table1_innodb_default` MODIFY `c34` TIME
Connection ID (thread ID): 1
Status: NOT_KILLED

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Excellent, can you reduce the testcase then?

Revision history for this message
Roel Van de Paar (roel11) wrote :

Ramesh, I can help with testcase reduction. Ping me.

Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :

Please find the attached testcase reducer.sh output.
mysql version : Percona-Server-5.5.37-rel35.0-655-debug.Linux.x86_64

{code}
--
--
2014-05-15 03:07:42 [*] [Stage V] [MULTI] Threads which reproduced the issue: #1 #2 #3 #4 #5 #6 #7 #8 #9 #10
2014-05-15 03:07:42 [*] [Stage V] [MULTI] All threads reproduced the issue: this issue is not sporadic
2014-05-15 03:07:42 [*] [Stage V] [MULTI] Deciding which verified output file to keep out of 10 threads
2014-05-15 03:07:42 [*] [Stage V] [MULTI] Found verified, maximum initial simplification file, at thread #1: Using it as new input file
2014-05-15 03:07:42 [Init] Initial number of lines in restructured input file: 35705
2014-05-15 03:07:42 [Info] Linecounts for restructured files are usually higher as INSERT lines are broken up etc.
--
--
{code}

tags: added: upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3135

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.