Debian Codegraph @

mysql-test/suite/innodb/t/alter_foreign_crash.test

raw
1 --source include/have_innodb.inc
2 --source include/have_debug_sync.inc
3 # The embedded server does not support restarting.
4 --source include/not_embedded.inc
5 --source include/have_case_sensitive_file_system.inc
6 --source include/have_lowercase0.inc
7
8 --echo #
9 --echo # Bug #20476395 DICT_LOAD_FOREIGNS() FAILED IN
10 --echo # COMMIT_INPLACE_ALTER_TABLE
11 --echo #
12
13 call mtr.add_suppression("InnoDB: Failed to load table");
14
15 CREATE DATABASE Bug;
16 CREATE TABLE Bug.parent(a SERIAL) ENGINE=INNODB;
17 CREATE TABLE Bug.child(a SERIAL, FOREIGN KEY f(a) REFERENCES Bug.parent(a))
18 ENGINE=INNODB;
19
20 create database bug;
21 use bug;
22
23 create table parent(a serial) engine=innodb;
24 create table child(a serial, foreign key fk (a) references parent(a))engine=innodb;
25
26 insert into parent values(1);
27 insert into child values(1);
28 drop database Bug;
29
30 connect (con1,localhost,root,,bug);
31 SET DEBUG_SYNC='innodb_rename_table_ready SIGNAL s1 WAIT_FOR s2 EXECUTE 2';
32 --send ALTER TABLE child ROW_FORMAT=DYNAMIC, ALGORITHM=COPY
33 connection default;
34 SET DEBUG_SYNC='now WAIT_FOR s1';
35 SET DEBUG_SYNC='now SIGNAL s2 WAIT_FOR s1';
36
37 --let $shutdown_timeout= 0
38 --source include/restart_mysqld.inc
39 disconnect con1;
40
41 show tables;
42 alter table parent row_format=dynamic;
43 select * from child;
44 --error ER_ROW_IS_REFERENCED_2
45 drop table parent;
46 drop table child;
47 drop table parent;
48 drop database bug;