Debian Codegraph @

mysql-test/suite/innodb/t/innodb-corrupted-table.test

raw
1 --source include/have_innodb.inc
2 --source include/not_embedded.inc
3
4 #
5 # MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD
6 #
7
8 call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MariaDB");
9 call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB");
10
11 create table t1 (pk int, i int, key(i)) engine=InnoDB;
12 insert into t1 values (1,1),(2,2);
13
14 --let $datadir= `select @@datadir`
15
16 flush tables;
17
18 --echo # Save the .frm file without the PK
19
20 --copy_file $datadir/test/t1.frm $MYSQLTEST_VARDIR/tmp/t1.frm
21
22 alter table t1 add primary key (pk);
23
24 --echo # Stop the server, replace the frm with the old one and restart the server
25
26 --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
27 --shutdown_server
28 --source include/wait_until_disconnected.inc
29
30 --remove_file $datadir/test/t1.frm
31 --copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm
32
33 --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
34 --enable_reconnect
35 --source include/wait_until_connected_again.inc
36
37 --enable_prepare_warnings
38 show create table t1;
39 select * from t1;
40 alter table t1 add j int;
41 show warnings;
42 show create table t1;
43 alter table t1 add primary key (pk);
44 show warnings;
45 show create table t1;
46 # Cleanup
47 drop table t1;