Show
added a comment - - edited Test case
--source include/have_innodb.inc
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
f1 int(11) DEFAULT NULL,
PRIMARY KEY (id),
CONSTRAINT fk1 FOREIGN KEY (f1) REFERENCES t1 (id) ON DELETE CASCADE
) ENGINE=InnoDB;
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
f2 int(11) NOT NULL,
f3 int(11) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE,
CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
) ENGINE=InnoDB;
Stack trace from f66fbe8ce0ff4ffcd6a6c185f9b3d25bd9f67f8d
#3 <signal handler called>
#4 0x00007ff9953f8023 in dict_foreign_remove_from_cache (foreign=0x7ff98b93f5f8) at 5.5/storage/innobase/dict/dict0dict.c:2536
#5 0x00007ff9953f561b in dict_table_remove_from_cache (table=0x7ff98b93f378) at 5.5/storage/innobase/dict/dict0dict.c:1368
#6 0x00007ff9954e3437 in row_drop_table_for_mysql (name=0x7ff98b822278 "test/t2", trx=0x7ff98b860c78, drop_db=0) at 5.5/storage/innobase/row/row0mysql.c:3419
#7 0x00007ff9954e1327 in row_table_add_foreign_constraints (trx=0x7ff98b860c78, sql_string=0x7ff98b951078 "CREATE TABLE t2 (\nid int(11) NOT NULL AUTO_INCREMENT,\nf2 int(11) NOT NULL,\nf3 int(11) NOT NULL,\nPRIMARY KEY (`id`),\nCONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE,\nCONSTRAINT f"..., sql_length=272, name=0x7ff99bea9270 "test/t2", reject_fks=0) at 5.5/storage/innobase/row/row0mysql.c:2190
#8 0x00007ff9954a6222 in ha_innodb::create (this=0x7ff98b985078, name=0x7ff99beaa9d0 "./test/t2", form=0x7ff99bea9b70, create_info=0x7ff99beaae40) at 5.5/storage/innobase/handler/ha_innodb.cc:7412
#9 0x00000000007eab98 in handler::ha_create (this=0x7ff98b985078, name=0x7ff99beaa9d0 "./test/t2", form=0x7ff99bea9b70, info=0x7ff99beaae40) at 5.5/sql/handler.cc:3755
#10 0x00000000007eb8a3 in ha_create_table (thd=0x7ff99394e060, path=0x7ff99beaa9d0 "./test/t2", db=0x7ff98b951918 "test", table_name=0x7ff98b951310 "t2", create_info=0x7ff99beaae40, update_create_info=false) at 5.5/sql/handler.cc:4084
#11 0x000000000070bf33 in rea_create_table (thd=0x7ff99394e060, path=0x7ff99beaa9d0 "./test/t2", db=0x7ff98b951918 "test", table_name=0x7ff98b951310 "t2", create_info=0x7ff99beaae40, create_fields=..., keys=3, key_info=0x7ff98b952980, file=0x7ff98ba83078) at 5.5/sql/unireg.cc:503
#12 0x00000000006cca99 in mysql_create_table_no_lock (thd=0x7ff99394e060, db=0x7ff98b951918 "test", table_name=0x7ff98b951310 "t2", create_info=0x7ff99beaae40, alter_info=0x7ff99beaada0, internal_tmp_table=false, select_field_count=0, is_trans=0x7ff99beaacde) at 5.5/sql/sql_table.cc:4498
#13 0x00000000006ccda5 in mysql_create_table (thd=0x7ff99394e060, create_table=0x7ff98b951348, create_info=0x7ff99beaae40, alter_info=0x7ff99beaada0) at 5.5/sql/sql_table.cc:4593
#14 0x00000000006327d6 in mysql_execute_command (thd=0x7ff99394e060) at 5.5/sql/sql_parse.cc:2645
#15 0x000000000063b20e in mysql_parse (thd=0x7ff99394e060, rawbuf=0x7ff98b951078 "CREATE TABLE t2 (\nid int(11) NOT NULL AUTO_INCREMENT,\nf2 int(11) NOT NULL,\nf3 int(11) NOT NULL,\nPRIMARY KEY (`id`),\nCONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE,\nCONSTRAINT f"..., length=272, parser_state=0x7ff99beab620) at 5.5/sql/sql_parse.cc:5909
#16 0x000000000062ee51 in dispatch_command (command=COM_QUERY, thd=0x7ff99394e060, packet=0x7ff993a76061 "CREATE TABLE t2 (\nid int(11) NOT NULL AUTO_INCREMENT,\nf2 int(11) NOT NULL,\nf3 int(11) NOT NULL,\nPRIMARY KEY (`id`),\nCONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE,\nCONSTRAINT f"..., packet_length=272) at 5.5/sql/sql_parse.cc:1079
#17 0x000000000062dfdd in do_command (thd=0x7ff99394e060) at 5.5/sql/sql_parse.cc:793
#18 0x0000000000730712 in do_handle_one_connection (thd_arg=0x7ff99394e060) at 5.5/sql/sql_connect.cc:1266
#19 0x00000000007301d1 in handle_one_connection (arg=0x7ff99394e060) at 5.5/sql/sql_connect.cc:1181
#20 0x0000000000b66ba1 in pfs_spawn_thread (arg=0x7ff9939a0480) at 5.5/storage/perfschema/pfs.cc:1015
#21 0x00007ff99bae3b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#22 0x00007ff99a3f170d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112