diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/atomic | |
parent | Initial commit. (diff) | |
download | mariadb-upstream.tar.xz mariadb-upstream.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/atomic')
52 files changed, 13126 insertions, 0 deletions
diff --git a/mysql-test/suite/atomic/README.txt b/mysql-test/suite/atomic/README.txt new file mode 100644 index 00000000..b1453d8a --- /dev/null +++ b/mysql-test/suite/atomic/README.txt @@ -0,0 +1,19 @@ +To debug a the ddl_recovery code in a failing ddl_recovery test one could do +the following: + +- Add # before --exec echo "restart" ... +- Force $e (engine), $c (crash point) and $r (crash position) to the values + where things goes wrong. See comments in alter_table.test for how to do this. +- start mariadbd in a debugger + +run the following in the debugger +(Replace 'atomic.create_trigger' with the failing test case) + +#break ha_recover +#break MYSQL_BIN_LOG::recover +#break MYSQL_BIN_LOG::open + +break ddl_log_close_binlogged_events +break ddl_log_execute_action +break ddl_log_execute_recovery +run --datadir=/my/maria-10.6/mysql-test/var/log/atomic.create_trigger/mysqld.1/data --log-basename=master --log-bin-index=mysqld-bin.index --debug --log-bin diff --git a/mysql-test/suite/atomic/alter_partition,innodb.rdiff b/mysql-test/suite/atomic/alter_partition,innodb.rdiff new file mode 100644 index 00000000..571136eb --- /dev/null +++ b/mysql-test/suite/atomic/alter_partition,innodb.rdiff @@ -0,0 +1,525 @@ +--- alter_partition.result ++++ alter_partition,innodb.reject +@@ -17,12 +17,9 @@ + end $ + # QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 + # CRASH: crash_create_before_create_frm +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -38,12 +35,9 @@ + 12 + 22 + # CRASH: crash_alter_partition_after_create_frm +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -59,12 +53,9 @@ + 12 + 22 + # CRASH: crash_alter_partition_after_write_frm +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -80,12 +71,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_1 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -101,12 +89,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_2 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -122,12 +107,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_3 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -143,12 +125,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_4 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -164,12 +143,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_5 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -185,12 +161,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_6 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -206,12 +179,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_7 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -227,12 +197,9 @@ + 12 + 22 + # CRASH: crash_convert_partition_8 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par + Table Create Table +@@ -248,15 +215,12 @@ + 12 + 22 + # CRASH: crash_convert_partition_9 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp1.MYD +-tp1.MYI + tp1.frm ++tp1.ibd + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 + Table Create Table + t1 CREATE TABLE `t1` ( +@@ -275,15 +239,12 @@ + x + 12 + # CRASH: crash_convert_partition_10 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp1.MYD +-tp1.MYI + tp1.frm ++tp1.ibd + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 + Table Create Table + t1 CREATE TABLE `t1` ( +@@ -302,15 +263,12 @@ + x + 12 + # CRASH: crash_convert_partition_11 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp1.MYD +-tp1.MYI + tp1.frm ++tp1.ibd + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 + Table Create Table + t1 CREATE TABLE `t1` ( +@@ -330,14 +288,10 @@ + 12 + # QUERY: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) + # NO CRASH: crash_create_before_create_frm +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#p2.MYD +-t1#P#p2.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#p2.ibd ++t1#P#pn.ibd + t1.frm + t1.par + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +@@ -357,14 +311,10 @@ + 32 + 39 + # NO CRASH: crash_alter_partition_after_create_frm +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#p2.MYD +-t1#P#p2.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#p2.ibd ++t1#P#pn.ibd + t1.frm + t1.par + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +@@ -384,14 +334,10 @@ + 32 + 39 + # NO CRASH: crash_alter_partition_after_write_frm +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#p2.MYD +-t1#P#p2.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#p2.ibd ++t1#P#pn.ibd + t1.frm + t1.par + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +@@ -411,17 +357,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_1 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -442,17 +384,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_2 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -473,17 +411,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_3 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -504,17 +438,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_4 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -535,17 +465,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_5 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -566,17 +492,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_6 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -597,17 +519,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_7 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -628,17 +546,13 @@ + 32 + 39 + # CRASH: crash_convert_partition_8 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#pn.ibd + t1.frm + t1.par +-tp2.MYD +-tp2.MYI + tp2.frm ++tp2.ibd + Table Create Table + t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +@@ -659,14 +573,10 @@ + 32 + 39 + # CRASH: crash_convert_partition_9 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#p2.MYD +-t1#P#p2.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#p2.ibd ++t1#P#pn.ibd + t1.frm + t1.par + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +@@ -686,14 +596,10 @@ + 32 + 39 + # CRASH: crash_convert_partition_10 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#p2.MYD +-t1#P#p2.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#p2.ibd ++t1#P#pn.ibd + t1.frm + t1.par + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +@@ -713,14 +619,10 @@ + 32 + 39 + # CRASH: crash_convert_partition_11 +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI +-t1#P#p2.MYD +-t1#P#p2.MYI +-t1#P#pn.MYD +-t1#P#pn.MYI ++t1#P#p0.ibd ++t1#P#p1.ibd ++t1#P#p2.ibd ++t1#P#pn.ibd + t1.frm + t1.par + master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) diff --git a/mysql-test/suite/atomic/alter_partition.combinations b/mysql-test/suite/atomic/alter_partition.combinations new file mode 100644 index 00000000..898d2f2f --- /dev/null +++ b/mysql-test/suite/atomic/alter_partition.combinations @@ -0,0 +1,6 @@ +[innodb] +innodb + +[myisam] + +[aria] diff --git a/mysql-test/suite/atomic/alter_partition.result b/mysql-test/suite/atomic/alter_partition.result new file mode 100644 index 00000000..c4af43ad --- /dev/null +++ b/mysql-test/suite/atomic/alter_partition.result @@ -0,0 +1,743 @@ +# Crash recovery +create or replace procedure prepare_table(r int) +begin +create or replace table t1 (x int) +with system versioning +partition by range(x) ( +partition p0 values less than (10), +partition p1 values less than (20), +partition pn values less than (30)); +insert into t1 values (2), (12), (22); +if r > 1 then +create or replace table tp2 (x int) +with system versioning; +insert into tp2 values (32), (39); +end if; +flush tables; +end $ +# QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 +# CRASH: crash_create_before_create_frm +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_alter_partition_after_create_frm +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_alter_partition_after_write_frm +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_1 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_2 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_3 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_4 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_5 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_6 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_7 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_8 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +# CRASH: crash_convert_partition_9 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp1.MYD +tp1.MYI +tp1.frm +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +22 +Table Create Table +tp1 CREATE TABLE `tp1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +12 +# CRASH: crash_convert_partition_10 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp1.MYD +tp1.MYI +tp1.frm +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +22 +Table Create Table +tp1 CREATE TABLE `tp1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +12 +# CRASH: crash_convert_partition_11 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp1.MYD +tp1.MYI +tp1.frm +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1 +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +22 +Table Create Table +tp1 CREATE TABLE `tp1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +12 +# QUERY: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +# NO CRASH: crash_create_before_create_frm +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE, + PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +32 +39 +# NO CRASH: crash_alter_partition_after_create_frm +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE, + PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +32 +39 +# NO CRASH: crash_alter_partition_after_write_frm +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE, + PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +32 +39 +# CRASH: crash_convert_partition_1 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_2 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_3 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_4 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_5 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_6 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_7 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_8 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +tp2.MYD +tp2.MYI +tp2.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +Table Create Table +tp2 CREATE TABLE `tp2` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING +x +32 +39 +# CRASH: crash_convert_partition_9 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE, + PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +32 +39 +# CRASH: crash_convert_partition_10 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE, + PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +32 +39 +# CRASH: crash_convert_partition_11 +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#pn.MYD +t1#P#pn.MYI +t1.frm +t1.par +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40) +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING + PARTITION BY RANGE (`x`) +(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE, + PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE, + PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE, + PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE) +x +2 +12 +22 +32 +39 +Warnings: +Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/alter_partition.test b/mysql-test/suite/atomic/alter_partition.test new file mode 100644 index 00000000..23b996cf --- /dev/null +++ b/mysql-test/suite/atomic/alter_partition.test @@ -0,0 +1,174 @@ +--source include/have_partition.inc +--source include/have_debug.inc +--source include/have_sequence.inc +--source include/binlog_combinations.inc +--source include/have_binlog_format_row_or_statement.inc +--source include/not_valgrind.inc + +let $default_engine=InnoDB; +let $extra_option=; +let $save_debug=`select @@debug_dbug`; + +if ($MTR_COMBINATION_MYISAM) +{ + let $default_engine=MyISAM; +} +if ($MTR_COMBINATION_ARIA) +{ + let $default_engine=Aria; + let $extra_option=transactional=1; +} + +if ($MTR_COMBINATION_STMT) +{ + let $binlog_format=include/set_binlog_format_statement.sql; +} +if ($MTR_COMBINATION_ROW) +{ + let $binlog_format=include/set_binlog_format_row.sql; +} + +--disable_query_log +--eval set @@default_storage_engine=$default_engine +--enable_query_log + +--echo # Crash recovery + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $crash_count= 14; +let $crash_points='crash_create_before_create_frm', + 'crash_alter_partition_after_create_frm', + 'crash_alter_partition_after_write_frm', + 'crash_convert_partition_1', + 'crash_convert_partition_2', + 'crash_convert_partition_3', + 'crash_convert_partition_4', + 'crash_convert_partition_5', + 'crash_convert_partition_6', + 'crash_convert_partition_7', + 'crash_convert_partition_8', + 'crash_convert_partition_9', + 'crash_convert_partition_10', + 'crash_convert_partition_11'; + +#let $crash_count= 1; +#let $crash_points= 'crash_convert_partition_10'; + +let $statement_count= 2; +let $statements= 'ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1', + 'ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)'; + +#let $statement_count= 1; +#let $statements= 'ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)'; + +--delimiter $ +create or replace procedure prepare_table(r int) +begin + create or replace table t1 (x int) + with system versioning + partition by range(x) ( + partition p0 values less than (10), + partition p1 values less than (20), + partition pn values less than (30)); + insert into t1 values (2), (12), (22); + + if r > 1 then + create or replace table tp2 (x int) + with system versioning; + insert into tp2 values (32), (39); + end if; + + flush tables; +end $ +--delimiter ; + +let $old_debug=`select @@debug_dbug`; + +let $keep_include_silent=1; +let $grep_script=ALTER; +--disable_query_log + +let $r=0; +while ($r < $statement_count) +{ + inc $r; + let $statement=`select ELT($r, $statements)`; + --echo # QUERY: $statement + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + + --eval set @@default_storage_engine=$default_engine + eval call prepare_table($r); + if (!$c) + { + lock tables t1 write; + } + + --source $binlog_format + + RESET MASTER; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash" + let $errno=0; + --error 0,2013 + --eval $statement; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + --echo # NO CRASH: $crash + } + if ($error) + { + --echo # CRASH: $crash + } + # Check which tables still exists + --replace_result MAI MYI MAD MYD + --list_files $MYSQLD_DATADIR/test t* + --replace_regex /backup-\d+/backup/ + --list_files $MYSQLD_DATADIR/test *sql* + --remove_files_wildcard $MYSQLD_DATADIR/test *sql-backup-* + + --let $binlog_file=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file=master-bin.000002 + --source include/show_binlog_events.inc + } + + --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' '' + show create table t1; + select * from t1; + --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' '' + --error 0, ER_NO_SUCH_TABLE + show create table tp1; + --error 0, ER_NO_SUCH_TABLE + select * from tp1; + --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' '' + --error 0, ER_NO_SUCH_TABLE + show create table tp2; + --error 0, ER_NO_SUCH_TABLE + select * from tp2; + # Drop the tables. The warnings will show what was dropped + --disable_warnings + drop table t1; + drop table if exists tp1; + --enable_warnings + } +} +drop table if exists t1; +drop procedure prepare_table; +--eval set @@debug_dbug="$save_debug" + +--enable_query_log diff --git a/mysql-test/suite/atomic/alter_table.opt b/mysql-test/suite/atomic/alter_table.opt new file mode 100644 index 00000000..61f3ce08 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table.opt @@ -0,0 +1 @@ +--innodb-max-dirty-pages-pct=0 diff --git a/mysql-test/suite/atomic/alter_table.result b/mysql-test/suite/atomic/alter_table.result new file mode 100644 index 00000000..8475f3c8 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table.result @@ -0,0 +1,3135 @@ +create database test2; +RESET MASTER; + +engine: myisam + + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +query: ALTER TABLE t1 COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column a c int COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_before_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +query: ALTER TABLE t1 disable keys + +crash point: ddl_log_alter_after_create_frm +"No crash!" +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +"No crash!" +crash point: ddl_log_alter_after_log +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +query: ALTER TABLE t1 rename t2 + +crash point: ddl_log_alter_after_create_frm +"No crash!" +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +"No crash!" +crash point: ddl_log_alter_after_log +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_rename_triggers +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_log +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column a c int COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_log +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ENGINE=aria, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" + +query: ALTER TABLE t1 change column a c int COMMENT "new", engine=aria + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_to_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_delete_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_drop_original_table +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_before_rename_triggers +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_drop_original_table +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +query: ALTER TABLE t1 COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MYD +t2.MYI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD key(b), COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" + +query: ALTER TABLE t1 DROP INDEX a + +crash point: ddl_log_alter_after_create_frm +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_rename_to_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_drop_original_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a + +engine: innodb + + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column a c int COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 disable keys + +crash point: ddl_log_alter_after_create_frm +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_create_table +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_copy +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_log +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_rename_frm +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_delete_backup +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +Warnings: +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +query: ALTER TABLE t1 rename t2 + +crash point: ddl_log_alter_after_create_frm +"No crash!" +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +"No crash!" +crash point: ddl_log_alter_after_log +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_rename_triggers +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column a c int COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +t2.ibd +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ENGINE=aria, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" + +query: ALTER TABLE t1 change column a c int COMMENT "new", engine=aria + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_to_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_delete_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_drop_original_table +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.frm +t2.ibd +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +t2.ibd +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.frm +t2.ibd +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +t2.ibd +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD key(b), COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 DROP INDEX a + +crash point: ddl_log_alter_after_create_frm +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +t1.ibd +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" diff --git a/mysql-test/suite/atomic/alter_table.test b/mysql-test/suite/atomic/alter_table.test new file mode 100644 index 00000000..1f87b7e7 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table.test @@ -0,0 +1,193 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic create table with crashes in a lot of different places +# +# Things tested: +# With myisam and InnoDB engines to ensure that cover both normal and +# online alter table paths. +# Alter table with new columns +# Alter table which only touches .frm +# Alter table disable keys (has it own code path) +# Alter table with rename +# Alter table with rename and only options that touches .frm +# Alter table with rename and add new columns +# Alter table with storage engine change (with and without column definition +# changes) +# Alter table with storage engine change and rename +# Alter table to another database + +--disable_query_log +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +--enable_query_log +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +create database test2; +RESET MASTER; + +if ($engine_count == "") +{ + let $engine_count=2; + let $engines='myisam','innodb'; +} +if ($extra_engine == "") +{ + let $extra_engine=aria; +} + +let $crash_count=13; +let $crash_points='ddl_log_alter_after_create_frm', 'ddl_log_alter_after_create_table', 'ddl_log_alter_after_prepare_inplace','ddl_log_alter_after_copy', 'ddl_log_alter_after_log', 'ddl_log_alter_after_rename_to_backup', 'ddl_log_alter_after_rename_to_backup_log', 'ddl_log_alter_rename_frm', 'ddl_log_alter_after_rename_to_original', 'ddl_log_alter_before_rename_triggers', 'ddl_log_alter_after_rename_triggers', 'ddl_log_alter_after_delete_backup', 'ddl_log_alter_after_drop_original_table'; + +let $statement_count=16; +let $statements='ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new"', + 'ALTER TABLE t1 COMMENT "new"', + 'ALTER TABLE t1 change column a c int COMMENT "new"', + 'ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2', + 'ALTER TABLE t1 disable keys', + 'ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new"', + 'ALTER TABLE t1 rename t2', + 'ALTER TABLE t1 COMMENT "new", rename t2', + 'ALTER TABLE t1 change column a c int COMMENT "new", rename t2', + 'ALTER TABLE t1 ENGINE=$extra_engine, COMMENT "new"', + 'ALTER TABLE t1 change column a c int COMMENT "new", engine=$extra_engine', + 'ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=$extra_engine', + 'ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2', + 'ALTER TABLE t1 COMMENT "new", rename test2.t2', + 'ALTER TABLE t1 ADD key(b), COMMENT "new"', + 'ALTER TABLE t1 DROP INDEX a'; + +# If there is a need of testing one specific state (crash point and query), +# one can use the comments below to execute one specific test combination +#let $crash_count=1; +#let $crash_points='ddl_log_alter_after_create_frm'; +#let $statement_count= 1; +#let $statements='ALTER TABLE t1 ADD COLUMN c int, COMMENT "new"'; +#let $engine_count=1; +#let $engines='rocksdb'; +#--source include/have_rocksdb.inc + +let $old_debug=`select @@debug_dbug`; +let $e=0; +let $keep_include_silent=1; +let $grep_script=ALTER; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + + --echo + --echo engine: $engine + --echo + + let $r=0; + while ($r < $statement_count) + { + inc $r; + let $statement=`select ELT($r, $statements)`; + --echo + --echo query: $statement + --echo + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + + --eval create table t1 (a int, b int, key(a)) engine=$engine + insert into t1 values (1,1),(2,2); + commit; + flush tables; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --echo crash point: $crash + if ($crash_count > 1) + { + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + } +# The following can be used for testing one specific failure +# if ($crash == "ddl_log_alter_after_log") +# { +# if ($r == 2) +# { +# --remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +# } +# } + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 + let $errno=0; + --error 0,2013 + --eval $statement; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + if ($error != 0) + { + --list_files $MYSQLD_DATADIR/test t* + --list_files $MYSQLD_DATADIR/test *sql* + --list_files $MYSQLD_DATADIR/test2 t* + --list_files $MYSQLD_DATADIR/test2 *sql* + # Check which tables still exists + --error 0,1 + --file_exists $MYSQLD_DATADIR/test/t1.frm + let $error2=$errno; + if ($error2 == 0) + { + show create table t1; + select count(*) from t1; + } + if ($error2 == 1) + { + --error 0,1 + --file_exists $MYSQLD_DATADIR/test/t2.frm + let $error3=$errno; + if ($error3 == 0) + { + show create table t2; + select count(*) from t2; + } + if ($error3 == 1) + { + --echo "Table is in test2" + show create table test2.t2; + select count(*) from test2.t2; + } + } + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + } + --disable_warnings + drop table if exists t1,t2; + drop table if exists test2.t2; + --enable_warnings + } + } +} +drop database test2; +--enable_query_log diff --git a/mysql-test/suite/atomic/alter_table_aria.result b/mysql-test/suite/atomic/alter_table_aria.result new file mode 100644 index 00000000..c75bbcff --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_aria.result @@ -0,0 +1,1741 @@ +create database test2; +RESET MASTER; + +engine: aria + + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +query: ALTER TABLE t1 COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column a c int COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +query: ALTER TABLE t1 disable keys + +crash point: ddl_log_alter_after_create_frm +"No crash!" +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +"No crash!" +crash point: ddl_log_alter_after_log +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +query: ALTER TABLE t1 rename t2 + +crash point: ddl_log_alter_after_create_frm +"No crash!" +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +"No crash!" +crash point: ddl_log_alter_after_log +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_rename_triggers +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_copy +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column a c int COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_copy +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ENGINE=myisam, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=myisam, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=myisam, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=myisam, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=myisam, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=myisam, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=myisam, COMMENT "new" + +query: ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam +crash point: ddl_log_alter_after_rename_to_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam +crash point: ddl_log_alter_after_drop_original_table +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=myisam + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_after_rename_to_backup +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_before_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_after_rename_triggers +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_after_delete_backup +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam +crash point: ddl_log_alter_after_drop_original_table +t2.MYD +t2.MYI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=myisam + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_drop_original_table +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +query: ALTER TABLE t1 COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 ADD key(b), COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" + +query: ALTER TABLE t1 DROP INDEX a + +crash point: ddl_log_alter_after_create_frm +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a diff --git a/mysql-test/suite/atomic/alter_table_aria.test b/mysql-test/suite/atomic/alter_table_aria.test new file mode 100644 index 00000000..6bf44b04 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_aria.test @@ -0,0 +1,7 @@ +# +# Test atomic alter table with aria + +let $engine_count=1; +let $engines='aria'; +let $extra_engine=myisam; +--source alter_table.test diff --git a/mysql-test/suite/atomic/alter_table_big_query.result b/mysql-test/suite/atomic/alter_table_big_query.result new file mode 100644 index 00000000..29fb4456 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_big_query.result @@ -0,0 +1,34 @@ + +engine: myisam + + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +sum(a) +3 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/* long code comment: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy*/ + +query: ALTER TABLE t1 COMMENT "new" + +crash point: ddl_log_alter_after_log +t1.MYD +t1.MYI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +sum(a) +3 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/* long code comment: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy*/ diff --git a/mysql-test/suite/atomic/alter_table_big_query.test b/mysql-test/suite/atomic/alter_table_big_query.test new file mode 100644 index 00000000..682259cd --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_big_query.test @@ -0,0 +1,119 @@ +--source include/have_debug.inc +--source include/have_sequence.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of query > 4K. For this we do not have to run many tests as we +# only want to test the query storage, which is identical for all cases. +# + +--disable_query_log +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; + +--enable_query_log +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=1; +let $engines='myisam'; + +let $crash_count=1; +let $crash_points='ddl_log_alter_after_log'; + +let $statement_count=2; +let $statements='ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new"', + 'ALTER TABLE t1 COMMENT "new"'; + +# If there is a need of testing one specific state (crash point and query), +# one can remove the comments below and modify them. +#let $crash_count=1; +#let $crash_points='ddl_log_alter_before_rename_triggers'; +#let $statement_count= 1; +#let $statements='ALTER TABLE t1 change column b c int, COMMENT "new"'; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=ALTER; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + + --echo + --echo engine: $engine + --echo + + let $r=0; + while ($r < $statement_count) + { + inc $r; + let $statement=`select ELT($r, $statements)`; + --echo + --echo query: $statement + let $statement=`select concat(replace('$statement', "new", repeat("x",2000)), "/* long code comment: ", repeat("y",6000), "*/")`; + --echo + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + + --eval create table t1 (a int, b int) engine=$engine + insert into t1 (a) values (1),(2); + flush tables; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --echo crash point: $crash + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 + let $errno=0; + --error 0,2013 + --eval $statement; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + if ($error != 0) + { + --list_files $MYSQLD_DATADIR/test t* + --list_files $MYSQLD_DATADIR/test *sql* + show create table t1; + select sum(a) from t1; + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + } + --disable_warnings + drop table if exists t1,t2; + --enable_warnings + } + } +} + +--enable_query_log diff --git a/mysql-test/suite/atomic/alter_table_rocksdb.result b/mysql-test/suite/atomic/alter_table_rocksdb.result new file mode 100644 index 00000000..5dd877ad --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_rocksdb.result @@ -0,0 +1,1764 @@ +set global rocksdb_flush_log_at_trx_commit=1; +create database test2; +RESET MASTER; + +engine: rocksdb + + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new" + +query: ALTER TABLE t1 COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new" + +query: ALTER TABLE t1 change column a c int COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new" + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_before_rename_triggers +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +query: ALTER TABLE t1 disable keys + +crash point: ddl_log_alter_after_create_frm +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_create_table +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_copy +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_log +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_rename_frm +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_delete_backup +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +Warnings: +Note 1031 Storage engine ROCKSDB of the table `test`.`t1` doesn't have this option +"No crash!" + +query: ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, ALGORITHM=copy, COMMENT "new" + +query: ALTER TABLE t1 rename t2 + +crash point: ddl_log_alter_after_create_frm +"No crash!" +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +"No crash!" +crash point: ddl_log_alter_after_log +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_rename_triggers +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_before_rename_triggers +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 + +query: ALTER TABLE t1 change column a c int COMMENT "new", rename t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_before_rename_triggers +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_delete_backup +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", rename t2 + +query: ALTER TABLE t1 ENGINE=aria, COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ENGINE=aria, COMMENT "new" + +query: ALTER TABLE t1 change column a c int COMMENT "new", engine=aria + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_rename_to_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_rename_to_backup_log +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria +crash point: ddl_log_alter_after_drop_original_table +t1.MAD +t1.MAI +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL COMMENT 'new', + `b` int(11) DEFAULT NULL, + KEY `a` (`c`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column a c int COMMENT "new", engine=aria + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_to_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_to_backup_log +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_before_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_rename_triggers +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_delete_backup +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria +crash point: ddl_log_alter_after_drop_original_table +t2.MAD +t2.MAI +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2, engine=aria + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_before_rename_triggers +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_drop_original_table +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename test2.t2 + +query: ALTER TABLE t1 COMMENT "new", rename test2.t2 + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_to_backup_log +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_before_rename_triggers +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_rename_triggers +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_delete_backup +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 +crash point: ddl_log_alter_after_drop_original_table +t2.frm +"Table is in test2" +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename test2.t2 + +query: ALTER TABLE t1 ADD key(b), COMMENT "new" + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_prepare_inplace +"No crash!" +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_rename_to_backup_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" +crash point: ddl_log_alter_after_drop_original_table +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD key(b), COMMENT "new" + +query: ALTER TABLE t1 DROP INDEX a + +crash point: ddl_log_alter_after_create_frm +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_create_table +"No crash!" +crash point: ddl_log_alter_after_prepare_inplace +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_copy +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +crash point: ddl_log_alter_after_log +t1.frm +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +count(*) +2 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 DROP INDEX a +crash point: ddl_log_alter_after_rename_to_backup +"No crash!" +crash point: ddl_log_alter_after_rename_to_backup_log +"No crash!" +crash point: ddl_log_alter_rename_frm +"No crash!" +crash point: ddl_log_alter_after_rename_to_original +"No crash!" +crash point: ddl_log_alter_before_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_rename_triggers +"No crash!" +crash point: ddl_log_alter_after_delete_backup +"No crash!" +crash point: ddl_log_alter_after_drop_original_table +"No crash!" diff --git a/mysql-test/suite/atomic/alter_table_rocksdb.test b/mysql-test/suite/atomic/alter_table_rocksdb.test new file mode 100644 index 00000000..fa34008d --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_rocksdb.test @@ -0,0 +1,6 @@ +--source include/have_rocksdb.inc + +let $engine_count=1; +let $engines='rocksdb'; +set global rocksdb_flush_log_at_trx_commit=1; +--source alter_table.test diff --git a/mysql-test/suite/atomic/alter_table_trigger.result b/mysql-test/suite/atomic/alter_table_trigger.result new file mode 100644 index 00000000..293be8d2 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_trigger.result @@ -0,0 +1,131 @@ + +engine: myisam + + +query: ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +crash point: ddl_log_alter_before_rename_triggers +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2 + +query: ALTER TABLE t1 COMMENT "new", rename t2 + +crash point: ddl_log_alter_before_rename_triggers +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +"No crash!" + +query: ALTER TABLE t1 change column b c int, COMMENT "new", rename t2 + +crash point: ddl_log_alter_before_rename_triggers +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column b c int, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_rename_triggers +t1_trg.TRN +t2.MYD +t2.MYI +t2.TRG +t2.frm +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new' +count(*) +2 +sum(a) +1003 +master-bin.000002 # Query # # use `test`; ALTER TABLE t1 change column b c int, COMMENT "new", rename t2 +crash point: ddl_log_alter_after_drop_original_table +"No crash!" diff --git a/mysql-test/suite/atomic/alter_table_trigger.test b/mysql-test/suite/atomic/alter_table_trigger.test new file mode 100644 index 00000000..1d6d5c22 --- /dev/null +++ b/mysql-test/suite/atomic/alter_table_trigger.test @@ -0,0 +1,149 @@ +--source include/have_debug.inc +--source include/have_sequence.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic create table with crashes in a lot of different places +# +# This is very similar to the alter_table.test, but includes testing of +# triggers in with ALTER TABLE .. RENAME. +# + +--disable_query_log +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +--enable_query_log +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=1; +let $engines='myisam','innodb'; + +let $crash_count=3; +let $crash_points='ddl_log_alter_before_rename_triggers', 'ddl_log_alter_after_rename_triggers', 'ddl_log_alter_after_drop_original_table'; + +let $statement_count=3; +let $statements='ALTER TABLE t1 ADD COLUMN c INT, COMMENT "new", rename t2', + 'ALTER TABLE t1 COMMENT "new", rename t2', + 'ALTER TABLE t1 change column b c int, COMMENT "new", rename t2'; + +# If there is a need of testing one specific state (crash point and query), +# one can remove the comments below and modify them. +#let $crash_count=1; +#let $crash_points='ddl_log_alter_before_rename_triggers'; +#let $statement_count= 1; +#let $statements='ALTER TABLE t1 change column b c int, COMMENT "new", rename t2'; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=ALTER; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + + --echo + --echo engine: $engine + --echo + + let $r=0; + while ($r < $statement_count) + { + inc $r; + let $statement=`select ELT($r, $statements)`; + --echo + --echo query: $statement + --echo + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + + --eval create table t1 (a int, b int) engine=$engine + insert into t1 (a) values (1),(2); + flush tables; + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + delimiter ;| + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + --echo crash point: $crash + if ($crash_count != 1) + { + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + } + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 + let $errno=0; + --error 0,2013 + --eval $statement; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + if ($error != 0) + { + --list_files $MYSQLD_DATADIR/test t* + --list_files $MYSQLD_DATADIR/test *sql* + # Check which tables still exists + --error 0,1 + --file_exists $MYSQLD_DATADIR/test/t1.frm + let $error2=$errno; + if ($error2 == 0) + { + show create table t1; + # Ensure that triggers work + insert into t1 (a) values(null); + select sum(a) from t1; + } + if ($error2 == 1) + { + show create table t2; + select count(*) from t2; + # Ensure that triggers work + insert into t2 (a) values(null); + select sum(a) from t2; + } + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + } + --disable_warnings + drop table if exists t1,t2; + --enable_warnings + } + } +} + +--enable_query_log diff --git a/mysql-test/suite/atomic/create_table.result b/mysql-test/suite/atomic/create_table.result new file mode 100644 index 00000000..acc78c76 --- /dev/null +++ b/mysql-test/suite/atomic/create_table.result @@ -0,0 +1,537 @@ +create table const_table (a int, b int) engine=myisam; +insert into const_table values (1,1),(2,2); +flush tables; +engine: myisam +query: CREATE TABLE t1 (a int) +crash point: ddl_log_create_before_create_frm +t2.MYD +t2.MYI +t2.frm +crash point: storage_engine_middle_of_create +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_before_create_table +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_create_table +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_drop +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_before_binlog +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_after_binlog +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_log_complete +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +query: CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_log_complete +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +query: CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_before_create_frm +t2.MYD +t2.MYI +t2.frm +crash point: storage_engine_middle_of_create +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_before_create_table +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_create_table +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_drop +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_before_binlog +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_after_binlog +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_log_complete +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +query: CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_log_complete +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +query: CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_before_create_frm +t2.MYD +t2.MYI +t2.frm +crash point: storage_engine_middle_of_create +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( + `seq` bigint(20) unsigned NOT NULL +) +master-bin.000001 # Annotate_rows # # CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_before_create_table +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_create_table +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_drop +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( + `seq` bigint(20) unsigned NOT NULL +) +master-bin.000001 # Annotate_rows # # CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_before_binlog +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_prepare_eof +t2.MYD +t2.MYI +t2.frm +crash point: ddl_log_create_after_binlog +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( + `seq` bigint(20) unsigned NOT NULL +) +master-bin.000001 # Annotate_rows # # CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_log_complete +t1.MYD +t1.MYI +t1.frm +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( + `seq` bigint(20) unsigned NOT NULL +) +master-bin.000001 # Annotate_rows # # CREATE TABLE t1 SELECT * from t2 +query: CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) +master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) +master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_log_complete +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) +master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t2 SELECT * from const_table +engine: innodb +query: CREATE TABLE t1 (a int) +crash point: ddl_log_create_before_create_frm +t2.frm +t2.ibd +crash point: storage_engine_middle_of_create +"No crash!" +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_before_create_table +t2.frm +t2.ibd +crash point: ddl_log_create_after_create_table +t2.frm +t2.ibd +crash point: ddl_log_create_after_drop +"No crash!" +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_before_binlog +t2.frm +t2.ibd +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_after_binlog +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +crash point: ddl_log_create_log_complete +"No crash!" +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +query: CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_after_binlog +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_log_complete +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +query: CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_before_create_frm +t2.frm +t2.ibd +crash point: storage_engine_middle_of_create +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_before_create_table +t2.frm +t2.ibd +crash point: ddl_log_create_after_create_table +t2.frm +t2.ibd +crash point: ddl_log_create_after_drop +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_before_binlog +t2.frm +t2.ibd +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_after_binlog +t1.MYD +t1.MYI +t1.frm +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +crash point: ddl_log_create_log_complete +"No crash!" +t1.MYD +t1.MYI +t1.frm +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +query: CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_log_complete +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +query: CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_before_create_frm +t2.frm +t2.ibd +crash point: storage_engine_middle_of_create +"No crash!" +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_before_create_table +t2.frm +t2.ibd +crash point: ddl_log_create_after_create_table +t2.frm +t2.ibd +crash point: ddl_log_create_after_drop +"No crash!" +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +crash point: ddl_log_create_before_binlog +t2.frm +t2.ibd +crash point: ddl_log_create_after_prepare_eof +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t1` /* generated by ddl recovery */ +crash point: ddl_log_create_after_binlog +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t1` /* generated by ddl recovery */ +crash point: ddl_log_create_log_complete +t1.frm +t1.ibd +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +query: CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_binlog +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t2` /* generated by ddl recovery */ +crash point: ddl_log_create_log_complete +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +Warnings: +Note 1051 Unknown table 'test.t1,test.t2' diff --git a/mysql-test/suite/atomic/create_table.test b/mysql-test/suite/atomic/create_table.test new file mode 100644 index 00000000..ff53a12e --- /dev/null +++ b/mysql-test/suite/atomic/create_table.test @@ -0,0 +1,140 @@ +--source include/have_debug.inc +--source include/have_sequence.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic create table with crashes in a lot of different places +# +# We test both statement based logging and row logging as CREATE ... SELECT +# works a bit differently depending on the logging format +# First engine will use row logging and second engine will use statement +# based logging +# + +--disable_query_log +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +--enable_query_log +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +if ($engine_count == "") +{ + let $engine_count=2; + let $engines='myisam','innodb'; +} + +let $crash_count=9; +let $crash_points='ddl_log_create_before_create_frm', 'storage_engine_middle_of_create', 'ddl_log_create_before_create_table', 'ddl_log_create_after_create_table', 'ddl_log_create_after_drop', 'ddl_log_create_before_binlog', 'ddl_log_create_after_prepare_eof', 'ddl_log_create_after_binlog', 'ddl_log_create_log_complete'; + +let $statement_count=6; +let $statements='CREATE TABLE t1 (a int)', + 'CREATE OR REPLACE TABLE t2 (a int)', + 'CREATE TABLE t1 LIKE const_table', + 'CREATE OR REPLACE TABLE t2 LIKE const_table', + 'CREATE TABLE t1 SELECT * from t2', + 'CREATE OR REPLACE TABLE t2 SELECT * from const_table'; + +create table const_table (a int, b int) engine=myisam; +insert into const_table values (1,1),(2,2); +flush tables; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=CREATE|DROP; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + --echo engine: $engine + + let $r=0; + while ($r < $statement_count) + { + inc $r; + let $statement=`select ELT($r, $statements)`; + --echo query: $statement + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + + --eval set @@default_storage_engine=$default_engine + create or replace table t2 select * from seq_1_to_2; + flush tables; + + if ($e == 1) + { + --source include/set_binlog_format_row.sql + } + if ($e == 2) + { + --source include/set_binlog_format_statement.sql + } + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + --echo crash point: $crash + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 + let $errno=0; + --error 0,2013 + --eval $statement; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test t* + --list_files $MYSQLD_DATADIR/test *sql* + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Drop the tables. The warnings will show what was dropped + --disable_warnings + drop table if exists t1,t2; + --enable_warnings + } + } +} +drop table if exists t1,t2,const_table; + +--enable_query_log diff --git a/mysql-test/suite/atomic/create_trigger.result b/mysql-test/suite/atomic/create_trigger.result new file mode 100644 index 00000000..20b6c765 --- /dev/null +++ b/mysql-test/suite/atomic/create_trigger.result @@ -0,0 +1,324 @@ +RESET MASTER; +"engine: aria crash point: ddl_log_create_before_create_trigger position: 1" +"engine: aria crash point: ddl_log_create_before_create_trigger position: 2" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +"engine: aria crash point: ddl_log_create_before_create_trigger position: 3" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +"engine: aria crash point: ddl_log_create_after_create_trigger position: 1" +"engine: aria crash point: ddl_log_create_after_create_trigger position: 2" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +"engine: aria crash point: ddl_log_create_after_create_trigger position: 3" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +"engine: aria crash point: definition_file_after_create position: 1" +"engine: aria crash point: definition_file_after_create position: 2" +"engine: aria crash point: definition_file_after_create position: 3" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +"engine: aria crash point: ddl_log_drop_before_binlog position: 2" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +"engine: aria crash point: ddl_log_drop_before_binlog position: 3" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +"engine: aria crash point: ddl_log_drop_after_binlog position: 1" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +"engine: aria crash point: ddl_log_drop_after_binlog position: 2" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +"engine: aria crash point: ddl_log_drop_after_binlog position: 3" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 3000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 3000; +end if; +end +"engine: aria crash point: ddl_log_drop_before_delete_tmp position: 1" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +"engine: aria crash point: ddl_log_drop_before_delete_tmp position: 2" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +"engine: aria crash point: ddl_log_drop_before_delete_tmp position: 3" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 3000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 3000; +end if; +end diff --git a/mysql-test/suite/atomic/create_trigger.test b/mysql-test/suite/atomic/create_trigger.test new file mode 100644 index 00000000..09b00f99 --- /dev/null +++ b/mysql-test/suite/atomic/create_trigger.test @@ -0,0 +1,137 @@ +--source include/have_debug.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; + +# +# Testing of atomic CREATE TRIGGER with crashes in a lot of different places +# + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=1; +let $engines='aria'; + +let $crash_count=6; +let $crash_points='ddl_log_create_before_create_trigger', 'ddl_log_create_after_create_trigger', 'definition_file_after_create', 'ddl_log_drop_before_binlog', 'ddl_log_drop_after_binlog','ddl_log_drop_before_delete_tmp'; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=CREATE.*TRIGGER; +let $drops=3; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null, b int not null) $extra_option; + insert into t1 values(1,1); + flush tables; + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $drops) + { + inc $r; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + delimiter |; + --error 0,2013 + CREATE TRIGGER t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + delimiter ;| + let $error=$errno; + if ($error == 0) + { + delimiter |; + --error 0,2013 + CREATE OR REPLACE TRIGGER t2_trg before insert on t1 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + delimiter ;| + let $error=$errno; + } + if ($error == 0) + { + delimiter |; + --error 0,2013 + CREATE OR REPLACE TRIGGER t2_trg before insert on t1 for each row + begin + if isnull(new.b) then + set new.b:= 3000; + end if; + end| + delimiter ;| + let $error=$errno; + } + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test *TR* + --list_files $MYSQLD_DATADIR/test *sql* + + --replace_column 7 # + --error 0,ER_TRG_DOES_NOT_EXIST + SHOW CREATE TRIGGER t1_trg; + --replace_column 7 # + --error 0,ER_TRG_DOES_NOT_EXIST + SHOW CREATE TRIGGER t2_trg; + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + --disable_warnings + drop trigger if exists t1_trg; + drop trigger if exists t2_trg; + --enable_warnings + } + } +} + +drop table t1; + +--enable_query_log diff --git a/mysql-test/suite/atomic/create_trigger2.result b/mysql-test/suite/atomic/create_trigger2.result new file mode 100644 index 00000000..d239ac3b --- /dev/null +++ b/mysql-test/suite/atomic/create_trigger2.result @@ -0,0 +1,94 @@ +"position: 1" +"position: 2" +"position: 3" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +"position: 4" +t1.TRG +t1_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +"position: 5" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +"position: 6" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +"position: 7" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +"position: 8" +t1.TRG +t1_trg.TRN +t2_trg.TRN +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t1_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +t2_trg STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` trigger t2_trg before insert on t1 for each row +begin +if isnull(new.b) then +set new.b:= 3000; +end if; +end latin1 latin1_swedish_ci latin1_swedish_ci # diff --git a/mysql-test/suite/atomic/create_trigger2.test b/mysql-test/suite/atomic/create_trigger2.test new file mode 100644 index 00000000..b694207b --- /dev/null +++ b/mysql-test/suite/atomic/create_trigger2.test @@ -0,0 +1,89 @@ +--source include/have_debug.inc + +# +# Testing of atomic CREATE TRIGGER when write fails in create_definition_file +# + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=1; +let $engines='aria'; +let $old_debug=`select @@debug_dbug`; + +let $e=0; +--disable_query_log + +create table t1 (a int not null, b int not null); +insert into t1 values(1,1); +flush tables; + +# sql_create_definition_file is called twice per CREATE TRIGGER and 1 more +# in case we drop an existing trigger, so we need to test 3*2 +1 failures +# and also when there is no failures (= 8) +let $try_count=8; + +let $r=0; +while ($r < $try_count) +{ + inc $r; + + echo "position: $r"; + --eval set @@debug_dbug="+d,definition_file_simulate_write_error",@debug_error_counter=$r; + let $errno=0; + delimiter |; + --error 0,3 + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + delimiter ;| + let $error=$errno; + if ($error == 0) + { + delimiter |; + --error 0,3 + create or replace trigger t2_trg before insert on t1 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + delimiter ;| + let $error=$errno; + } + if ($error == 0) + { + delimiter |; + --error 0,3 + create or replace trigger t2_trg before insert on t1 for each row + begin + if isnull(new.b) then + set new.b:= 3000; + end if; + end| + delimiter ;| + let $error=$errno; + } + --eval set @@debug_dbug="$old_debug" + + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test *TR* + --list_files $MYSQLD_DATADIR/test *sql* + + --replace_column 7 # + --error 0,ER_TRG_DOES_NOT_EXIST + SHOW CREATE TRIGGER t1_trg; + --replace_column 7 # + --error 0,ER_TRG_DOES_NOT_EXIST + SHOW CREATE TRIGGER t2_trg; + --disable_warnings + drop trigger if exists t1_trg; + drop trigger if exists t2_trg; + --enable_warnings +} + +drop table t1; + +--enable_query_log diff --git a/mysql-test/suite/atomic/create_view.result b/mysql-test/suite/atomic/create_view.result new file mode 100644 index 00000000..3c38a651 --- /dev/null +++ b/mysql-test/suite/atomic/create_view.result @@ -0,0 +1,82 @@ +query: CREATE VIEW t1 as select "new" +crash point: ddl_log_create_before_copy_view +t2.frm +old +old +crash point: ddl_log_create_before_create_view +t2.frm +old +old +crash point: definition_file_after_create +t2.frm +old +old +crash point: ddl_log_create_after_create_view +t2.frm +old +old +crash point: ddl_log_create_before_binlog +t2.frm +old +old +crash point: ddl_log_create_after_binlog +t1.frm +t2.frm +old +old +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t1` AS select "new" +query: CREATE OR REPLACE VIEW t1 as select "new" +crash point: ddl_log_create_before_copy_view +t2.frm +old +old +crash point: ddl_log_create_before_create_view +t2.frm +old +old +crash point: definition_file_after_create +t2.frm +old +old +crash point: ddl_log_create_after_create_view +t2.frm +old +old +crash point: ddl_log_create_before_binlog +t2.frm +old +old +crash point: ddl_log_create_after_binlog +t1.frm +t2.frm +old +old +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t1` AS select "new" +query: CREATE OR REPLACE VIEW t2 as select "new" +crash point: ddl_log_create_before_copy_view +t2.frm +old +old +crash point: ddl_log_create_before_create_view +t2.frm +old +old +crash point: definition_file_after_create +t2.frm +old +old +crash point: ddl_log_create_after_create_view +t2.frm +old +old +crash point: ddl_log_create_before_binlog +t2.frm +old +old +crash point: ddl_log_create_after_binlog +t2.frm +new +new +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t2` AS select "new" +Warnings: +Note 4092 Unknown VIEW: 'test.t1,test.t2' diff --git a/mysql-test/suite/atomic/create_view.test b/mysql-test/suite/atomic/create_view.test new file mode 100644 index 00000000..bb7259cd --- /dev/null +++ b/mysql-test/suite/atomic/create_view.test @@ -0,0 +1,98 @@ +--source include/have_debug.inc +--source include/have_sequence.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic create view with crashes in a lot of different places + +--disable_query_log +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +--enable_query_log +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $crash_count=6; +let $crash_points='ddl_log_create_before_copy_view', 'ddl_log_create_before_create_view', 'definition_file_after_create','ddl_log_create_after_create_view', 'ddl_log_create_before_binlog', 'ddl_log_create_after_binlog'; + +let $statement_count=3; +let $statements='CREATE VIEW t1 as select "new"', + 'CREATE OR REPLACE VIEW t1 as select "new"', + 'CREATE OR REPLACE VIEW t2 as select "new"'; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=CREATE|DROP; +--disable_query_log + +while ($e < 1) +{ + inc $e; + + let $r=0; + while ($r < $statement_count) + { + inc $r; + + let $statement=`select ELT($r, $statements)`; + --echo query: $statement + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + + create view t2 as select "old"; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + --echo crash point: $crash + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 + let $errno=0; + --error 0,2013 + --eval $statement; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test t* + --list_files $MYSQLD_DATADIR/test *sql* + select * from t2; + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.00c0002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Drop the tables. The warnings will show what was dropped + --disable_warnings + drop view if exists t1,t2; + --enable_warnings + } + } +} +drop view if exists t1,t2; + +--enable_query_log diff --git a/mysql-test/suite/atomic/disabled.def b/mysql-test/suite/atomic/disabled.def new file mode 100644 index 00000000..3e1f2d6a --- /dev/null +++ b/mysql-test/suite/atomic/disabled.def @@ -0,0 +1,12 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment> +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +rename_trigger : MDEV-29282 2022:-08-16 Igor Babaev diff --git a/mysql-test/suite/atomic/drop_db.result b/mysql-test/suite/atomic/drop_db.result new file mode 100644 index 00000000..775f02ec --- /dev/null +++ b/mysql-test/suite/atomic/drop_db.result @@ -0,0 +1,96 @@ +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +RESET MASTER; +"engine: aria crash point: ddl_log_drop_before_delete_table position: 1" +t1v.frm +t2.MAD +t2.MAI +t2.frm +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_delete_table position: 2" +t1v.frm +t2.MAD +t2.MAI +t2.frm +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `t1v` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_delete_table position: 3" +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `t1v` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_tables position: 1" +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `t1v` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_ha_drop_database position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_db_routines position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_db_routines position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_option_file position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_dir position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_dir position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # DROP DATABASE test2 +"engine: innodb crash point: ddl_log_drop_before_delete_table position: 1" +t1v.frm +t2.frm +t2.ibd +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_delete_table position: 2" +t1v.frm +t2.frm +t2.ibd +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `t1v` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_delete_table position: 3" +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `t1v` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_drop_tables position: 1" +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +foo STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +insert into test.t1 values (42) latin1 latin1_swedish_ci latin1_swedish_ci +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `t1v` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_ha_drop_database position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_db_routines position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_drop_db_routines position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_option_file position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_dir position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_drop_dir position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # DROP DATABASE test2 +Warnings: +Note 1008 Can't drop database 'test2'; database doesn't exist diff --git a/mysql-test/suite/atomic/drop_db.test b/mysql-test/suite/atomic/drop_db.test new file mode 100644 index 00000000..0080ac5e --- /dev/null +++ b/mysql-test/suite/atomic/drop_db.test @@ -0,0 +1,121 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic DROP DATABASE with crashes in a lot of different places +# + +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=2; +let $engines='aria','innodb'; + +let $crash_count=10; +let $crash_points='ddl_log_drop_before_delete_table','ddl_log_drop_after_drop_tables','ddl_log_drop_before_ha_drop_database','ddl_log_drop_before_drop_db_routines','ddl_log_drop_after_drop_db_routines','ddl_log_drop_before_drop_option_file','ddl_log_drop_before_drop_dir','ddl_log_drop_after_drop_dir','ddl_log_drop_before_binlog','ddl_log_drop_after_binlog'; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=DROP; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + # Number of tables that should be dropped (we try to crash after each drop) + let $drops=3; + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $drops) + { + inc $r; + create database test2; + use test2; + --eval set @@default_storage_engine=$default_engine; + --eval create table t1 (a int not null) $extra_option; + create view t1v as select * from t1; + --eval create table t2 (b int not null) $extra_option; + create procedure foo() + insert into test.t1 values (42); + + flush tables; + use test; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + DROP DATABASE test2; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + use test; + # Check which tables still exists + --error 0,1 + --list_files $MYSQLD_DATADIR/test2 t* + --error 0,ER_SP_DOES_NOT_EXIST + show create procedure test2.foo; + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Really drop the tables. The warnings will show what was dropped + --disable_warnings + --error 0, ER_DB_DROP_EXISTS + DROP DATABASE test2; + --enable_warnings + } + # We only need to test drops for all tables for the first crash point + let $drops=1; + } +} +drop database if exists test2; + +--enable_query_log diff --git a/mysql-test/suite/atomic/drop_db_long_names.opt b/mysql-test/suite/atomic/drop_db_long_names.opt new file mode 100644 index 00000000..968c8f1a --- /dev/null +++ b/mysql-test/suite/atomic/drop_db_long_names.opt @@ -0,0 +1 @@ +--max-allowed-packet=1024 --net-buffer-length=1024 diff --git a/mysql-test/suite/atomic/drop_db_long_names.result b/mysql-test/suite/atomic/drop_db_long_names.result new file mode 100644 index 00000000..e1d177ab --- /dev/null +++ b/mysql-test/suite/atomic/drop_db_long_names.result @@ -0,0 +1,12 @@ +RESET MASTER; +"engine: aria crash point: ddl_log_drop_after_drop_tables position: 1" +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `tABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB`,`tACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC`,`tADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`,`tAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE`,`tAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF`,`tAGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG`,`tAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH`,`tAIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII`,`tAJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ`,`tAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK`,`tALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `tABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBv`,`tACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCv`,`tADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDv`,`tAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEv`,`tAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFv`,`tAGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGv`,`tAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHv`,`tAIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIv`,`tAJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJv`,`tAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKv` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `tAMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM`,`tANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN`,`tAOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO`,`tAPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP`,`tAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ`,`tARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR`,`tASSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS`,`tATTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT`,`tAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU`,`tAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV`,`tAWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `tALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLv`,`tAMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMv`,`tANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNv`,`tAOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOv`,`tAPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPv`,`tAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQv`,`tARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRv`,`tASSSSSSSSSSSSSSSSSSSSSSSSSSSSSSv`,`tATTTTTTTTTTTTTTTTTTTTTTTTTTTTTTv`,`tAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUv`,`tAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVv` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `tAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`,`tAYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY`,`tAZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ`,`tBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`,`tBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB`,`tBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC`,`tBDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`,`tBEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE` /* generated by ddl recovery */ +master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `tAWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWv`,`tAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXv`,`tAYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYv`,`tAZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZv`,`tBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv`,`tBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBv`,`tBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCv`,`tBDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDv`,`tBEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEv` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # DROP DATABASE IF EXISTS `test2` /* generated by ddl recovery */ +Warnings: +Note 1008 Can't drop database 'test2'; database doesn't exist diff --git a/mysql-test/suite/atomic/drop_db_long_names.test b/mysql-test/suite/atomic/drop_db_long_names.test new file mode 100644 index 00000000..af582afc --- /dev/null +++ b/mysql-test/suite/atomic/drop_db_long_names.test @@ -0,0 +1,117 @@ +--source include/have_debug.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; + +# +# Testing of atomic DROP DATABASE when the generated query could be too long +# + +let $engine_count=1; +let $engines='aria'; + +let $crash_count=2; +let $crash_points='ddl_log_drop_after_drop_tables','ddl_log_drop_before_binlog'; + +let $max_tables=30; + +let $old_debug=`select @@debug_dbug`; + +let $keep_include_silent=1; +let $grep_script=DROP; +--disable_query_log + +let $e=0; +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < 1) + { + inc $r; + create database test2; + use test2; + --eval set @@default_storage_engine=$default_engine + let $t=0; + while ($t < $max_tables) + { + inc $t; + let $name=`select concat("t",char(floor(65+$t/26)),repeat(char(65+mod($t,26)),60))`; + let $view=`select concat("t",char(floor(65+$t/26)),repeat(char(65+mod($t,26)),30),'v')`; + --eval create table $name (a int not null) $extra_option + --eval create view $view as select * from $name + } + + flush tables; + use test; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + DROP DATABASE test2; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + use test; + # Check which tables still exists + --error 0,1 + --list_files $MYSQLD_DATADIR/test2 t* + --error 0,ER_SP_DOES_NOT_EXIST + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Really drop the tables. The warnings will show what was dropped + --disable_warnings + --error 0, ER_DB_DROP_EXISTS + DROP DATABASE test2; + --enable_warnings + } + } +} +drop database if exists test2; + +--enable_query_log diff --git a/mysql-test/suite/atomic/drop_sequence.result b/mysql-test/suite/atomic/drop_sequence.result new file mode 100644 index 00000000..709b049b --- /dev/null +++ b/mysql-test/suite/atomic/drop_sequence.result @@ -0,0 +1,106 @@ +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +RESET MASTER; +create database test2; +"engine: aria crash point: ddl_log_drop_before_delete_table position: 1" +ts.MAD +ts.MAI +ts.frm +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_delete_table position: 2" +ts.MAD +ts.MAI +ts.frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_delete_table position: 3" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2`,`ts` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_table position: 1" +ts.MAD +ts.MAI +ts.frm +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_table position: 2" +ts.MAD +ts.MAI +ts.frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_table position: 3" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2`,`ts` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 1" +ts.MAD +ts.MAI +ts.frm +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 2" +ts.MAD +ts.MAI +ts.frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 3" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2`,`ts` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger2 position: 1" +ts.MAD +ts.MAI +ts.frm +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger2 position: 2" +ts.MAD +ts.MAI +ts.frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger2 position: 3" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2`,`ts` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 1" +ts.MAD +ts.MAI +ts.frm +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 2" +ts.MAD +ts.MAI +ts.frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 3" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2`,`ts` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`test2`.`t2`,`ts` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`test2`.`t2`,`ts` /* generated by server */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 3" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`test2`.`t2`,`ts` /* generated by server */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`test2`.`t2`,`ts` /* generated by server */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`test2`.`t2`,`ts` /* generated by server */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 3" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`test2`.`t2`,`ts` /* generated by server */ +Warnings: +Note 1051 Unknown table 'test.t1,test2.t2,test.ts' diff --git a/mysql-test/suite/atomic/drop_sequence.test b/mysql-test/suite/atomic/drop_sequence.test new file mode 100644 index 00000000..e3b707e8 --- /dev/null +++ b/mysql-test/suite/atomic/drop_sequence.test @@ -0,0 +1,128 @@ +--source include/have_debug.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic drop with crashes in a lot of different places +# We also test having the tables in different databases +# + +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +create database test2; + +let $engine_count=1; +let $engines='aria'; + +let $crash_count=7; +let $crash_points='ddl_log_drop_before_delete_table', 'ddl_log_drop_after_delete_table', 'ddl_log_drop_before_drop_trigger', 'ddl_log_drop_before_drop_trigger2', 'ddl_log_drop_after_drop_trigger', 'ddl_log_drop_before_binlog', 'ddl_log_drop_after_binlog'; + +# Number of drops in the tested statement +let $drops=3; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=DROP TABLE; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $drops) + { + inc $r; + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null) $extra_option; + --eval create table test2.t2 (b int not null) $extra_option; + create sequence ts; + insert into t1 values(1); + insert into test2.t2 values(2); + flush tables; + + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + create trigger test2.t2_trg before insert on test2.t2 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + delimiter ;| + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + drop table t1,test2.t2,ts; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test t* + --list_files $MYSQLD_DATADIR/test2 t* + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Really drop the tables. The warnings will show what was dropped + --disable_warnings + drop table if exists t1,test2.t2,ts; + --enable_warnings + } + } +} +drop table if exists t1,test2.t2,ts; +drop database test2; +--enable_query_log diff --git a/mysql-test/suite/atomic/drop_table.result b/mysql-test/suite/atomic/drop_table.result new file mode 100644 index 00000000..61ca91b2 --- /dev/null +++ b/mysql-test/suite/atomic/drop_table.result @@ -0,0 +1,274 @@ +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +RESET MASTER; +"engine: myisam crash point: ddl_log_drop_before_delete_table position: 1" +t2.MYD +t2.MYI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_after_delete_table position: 1" +t2.MYD +t2.MYI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_after_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_drop_trigger position: 1" +t2.MYD +t2.MYI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_drop_trigger2 position: 1" +t2.MYD +t2.MYI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_drop_trigger2 position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_after_drop_trigger position: 1" +t2.MYD +t2.MYI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_after_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: myisam crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: myisam crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: myisam crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: aria crash point: ddl_log_drop_before_delete_table position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_table position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger2 position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_drop_trigger2 position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: aria_notrans crash point: ddl_log_drop_before_delete_table position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_after_delete_table position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_after_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_drop_trigger position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_drop_trigger2 position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_drop_trigger2 position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_after_drop_trigger position: 1" +t2.MAD +t2.MAI +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_after_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: aria_notrans crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: aria_notrans crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: aria_notrans crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: innodb crash point: ddl_log_drop_before_delete_table position: 1" +t2.TRG +t2.frm +t2.ibd +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_delete_table position: 1" +t2.TRG +t2.frm +t2.ibd +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_trigger position: 1" +t2.TRG +t2.frm +t2.ibd +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_trigger2 position: 1" +t2.TRG +t2.frm +t2.ibd +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_drop_trigger2 position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_drop_trigger position: 1" +t2.TRG +t2.frm +t2.ibd +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_after_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: innodb crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: innodb crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: innodb crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: csv crash point: ddl_log_drop_before_delete_table position: 1" +t2.CSM +t2.CSV +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_after_delete_table position: 1" +t2.CSM +t2.CSV +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_after_delete_table position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_drop_trigger position: 1" +t2.CSM +t2.CSV +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_drop_trigger2 position: 1" +t2.CSM +t2.CSV +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_drop_trigger2 position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_after_drop_trigger position: 1" +t2.CSM +t2.CSV +t2.TRG +t2.frm +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_after_drop_trigger position: 2" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t2` /* generated by ddl recovery */ +"engine: csv crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: csv crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +"engine: csv crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +Warnings: +Note 1051 Unknown table 'test.t1,test.t2' diff --git a/mysql-test/suite/atomic/drop_table.test b/mysql-test/suite/atomic/drop_table.test new file mode 100644 index 00000000..a3635c76 --- /dev/null +++ b/mysql-test/suite/atomic/drop_table.test @@ -0,0 +1,125 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_csv.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic drop with crashes in a lot of different places +# + +call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=5; +let $engines='myisam','aria','aria_notrans','innodb','csv'; + +let $crash_count=7; +let $crash_points='ddl_log_drop_before_delete_table', 'ddl_log_drop_after_delete_table', 'ddl_log_drop_before_drop_trigger', 'ddl_log_drop_before_drop_trigger2', 'ddl_log_drop_after_drop_trigger', 'ddl_log_drop_before_binlog', 'ddl_log_drop_after_binlog'; + +# Number of drops in the tested statement +let $drops=2; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=DROP TABLE; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $drops) + { + inc $r; + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null) $extra_option; + --eval create table t2 (b int not null) $extra_option; + insert into t1 values(1); + insert into t2 values(2); + flush tables; + + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + create trigger t2_trg before insert on t2 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + delimiter ;| + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + drop table t1,t2; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test t* + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Really drop the tables. The warnings will show what was dropped + --disable_warnings + drop table if exists t1,t2; + --enable_warnings + } + } +} +drop table if exists t1,t2; + +--enable_query_log diff --git a/mysql-test/suite/atomic/drop_trigger.result b/mysql-test/suite/atomic/drop_trigger.result new file mode 100644 index 00000000..89d511f5 --- /dev/null +++ b/mysql-test/suite/atomic/drop_trigger.result @@ -0,0 +1,50 @@ +RESET MASTER; +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 1" +t1.TRG +t1_trg.TRN +t2_trg.TRN +"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 2" +t1.TRG +t2_trg.TRN +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +"engine: aria crash point: ddl_log_drop_before_drop_trn position: 1" +t1.TRG +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TRIGGER t1_trg +"engine: aria crash point: ddl_log_drop_before_drop_trn position: 2" +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +master-bin.000002 # Query # # use `test`; DROP TRIGGER t2_trg /* some comment */ +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 1" +t1.TRG +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TRIGGER t1_trg +"engine: aria crash point: ddl_log_drop_after_drop_trigger position: 2" +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +master-bin.000002 # Query # # use `test`; DROP TRIGGER t2_trg /* some comment */ +"engine: aria crash point: definition_file_after_create position: 1" +t1.TRG +t1_trg.TRN +t2_trg.TRN +"engine: aria crash point: definition_file_after_create position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +master-bin.000001 # Query # # use `test`; DROP TRIGGER t2_trg /* some comment */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +t1.TRG +t2_trg.TRN +master-bin.000002 # Query # # use `test`; DROP TRIGGER t1_trg +"engine: aria crash point: ddl_log_drop_before_binlog position: 2" +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +master-bin.000002 # Query # # use `test`; DROP TRIGGER t2_trg /* some comment */ +"engine: aria crash point: ddl_log_drop_after_binlog position: 1" +t1.TRG +t2_trg.TRN +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +"engine: aria crash point: ddl_log_drop_after_binlog position: 2" +master-bin.000001 # Query # # use `test`; DROP TRIGGER t1_trg +master-bin.000001 # Query # # use `test`; DROP TRIGGER t2_trg /* some comment */ + +# Test deleting not existing trigger +# +Warnings: +Note 1360 Trigger does not exist diff --git a/mysql-test/suite/atomic/drop_trigger.test b/mysql-test/suite/atomic/drop_trigger.test new file mode 100644 index 00000000..8ff4f309 --- /dev/null +++ b/mysql-test/suite/atomic/drop_trigger.test @@ -0,0 +1,132 @@ +--source include/have_debug.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic drop with crashes in a lot of different places +# + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let long_comment=`select repeat('a',16384)`; +let $engine_count=1; +let $engines='aria'; + +let $crash_count=6; +let $crash_points='ddl_log_drop_before_drop_trigger', 'ddl_log_drop_before_drop_trn','ddl_log_drop_after_drop_trigger', 'definition_file_after_create', 'ddl_log_drop_before_binlog', 'ddl_log_drop_after_binlog'; + +# Number of drops in the tested statement +let $drops=2; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=DROP TRIGGER; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $drops) + { + inc $r; + + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null, b int not null) $extra_option; + insert into t1 values(1,1); + flush tables; + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + create trigger t2_trg before insert on t1 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + delimiter ;| + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + let $crashed=1; + --error 0,2013 + DROP TRIGGER t1_trg; + let $error=$errno; + if ($error == 0) + { + --error 0,2013 + --eval DROP TRIGGER t2_trg /* $long_comment */; + let $error=$errno; + } + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test *TR* + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + --disable_warnings + drop table if exists t1; + --enable_warnings + } + let long_comment=some comment; + } +} + +--echo +--echo # Test deleting not existing trigger +--echo # + +drop trigger if exists `t1_trg`; + +--enable_query_log diff --git a/mysql-test/suite/atomic/drop_view.result b/mysql-test/suite/atomic/drop_view.result new file mode 100644 index 00000000..c5f850c6 --- /dev/null +++ b/mysql-test/suite/atomic/drop_view.result @@ -0,0 +1,21 @@ +RESET MASTER; +"engine: aria crash point: ddl_log_drop_before_delete_view position: 1" +v2.frm +master-bin.000002 # Query # # use `test`; DROP VIEW IF EXISTS `v1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_delete_view position: 2" +master-bin.000002 # Query # # use `test`; DROP VIEW IF EXISTS `v1`,`v2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_view position: 1" +v2.frm +master-bin.000002 # Query # # use `test`; DROP VIEW IF EXISTS `v1` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_after_delete_view position: 2" +master-bin.000002 # Query # # use `test`; DROP VIEW IF EXISTS `v1`,`v2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 1" +master-bin.000002 # Query # # use `test`; DROP VIEW IF EXISTS `v1`,`v2` /* generated by ddl recovery */ +"engine: aria crash point: ddl_log_drop_before_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP VIEW v1,v2 +"engine: aria crash point: ddl_log_drop_after_binlog position: 1" +master-bin.000001 # Query # # use `test`; DROP VIEW v1,v2 +"engine: aria crash point: ddl_log_drop_after_binlog position: 2" +"No crash!" +master-bin.000001 # Query # # use `test`; DROP VIEW v1,v2 diff --git a/mysql-test/suite/atomic/drop_view.test b/mysql-test/suite/atomic/drop_view.test new file mode 100644 index 00000000..e4c1daf9 --- /dev/null +++ b/mysql-test/suite/atomic/drop_view.test @@ -0,0 +1,110 @@ +--source include/have_debug.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# +# Testing of atomic drop of view with crashes in a lot of different places +# + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +let $engine_count=1; +let $engines='aria'; + +let $crash_count=4; +let $crash_points='ddl_log_drop_before_delete_view', 'ddl_log_drop_after_delete_view', 'ddl_log_drop_before_binlog', 'ddl_log_drop_after_binlog'; + +# Number of drops in the tested statement +let $drops=2; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +let $keep_include_silent=1; +let $grep_script=DROP ; +--disable_query_log + +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null) $extra_option; + --eval create table t2 (b int not null) $extra_option; + insert into t1 values(1); + insert into t2 values(2); + flush tables; + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $drops) + { + inc $r; + create view v1 as select * from t1; + create view v2 as select * from t1; + + FLUSH BINARY LOGS; + --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + + echo "engine: $engine crash point: $crash position: $r"; + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + DROP VIEW v1,v2; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + } + # Check which tables still exists + --list_files $MYSQLD_DATADIR/test v* + + --let $binlog_file=$start_binlog_file + --let $binlog_output_name=master-bin.000001 + --source include/show_binlog_events.inc + if ($error) + { + --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $binlog_output_name=master-bin.000002 + if ($binlog_file != $start_binlog_file) + { + --source include/show_binlog_events.inc + } + } + # Really drop the views + --disable_warnings + drop view if exists v1,v2; + --enable_warnings + } + } + drop table t1,t2; +} + +--enable_query_log diff --git a/mysql-test/suite/atomic/rename_case.result b/mysql-test/suite/atomic/rename_case.result new file mode 100644 index 00000000..4b58c555 --- /dev/null +++ b/mysql-test/suite/atomic/rename_case.result @@ -0,0 +1,52 @@ +create database test2; +# +# Testing rename error in different places +# +create table t1 (a int); +create table T2 (b int); +create table t3 (c int); +create table T4 (d int); +insert into t1 values(1); +insert into T2 values(2); +insert into t3 values(3); +insert into T4 values(4); +create temporary table tmp1 (a int); +create temporary table tmp2 (b int); +create temporary table tmp3 (c int); +create temporary table tmp4 (d int); +insert into tmp1 values(11); +insert into tmp2 values(22); +insert into tmp3 values(33); +insert into tmp4 values(44); +rename table t3 to T4, t1 to t5, T2 to t1, t5 to T2; +ERROR 42S01: Table 'T4' already exists +rename table t1 to t5, t3 to T4, T2 to t1, t5 to T2; +ERROR 42S01: Table 'T4' already exists +rename table t1 to t5, T2 to t1, t3 to T4, t5 to T2; +ERROR 42S01: Table 'T4' already exists +rename table t1 to t5, T2 to t1, t5 to T2, t3 to T4; +ERROR 42S01: Table 'T4' already exists +# Try failed rename using two databases +rename table test.t1 to test2.t5, test.T2 to test.t1, t5 to test.T2; +ERROR 42S02: Table 'test.t5' doesn't exist +select t1.a+T2.b+t3.c+T4.d from t1,T2,t3,T4; +t1.a+T2.b+t3.c+T4.d +10 +select * from t5; +ERROR 42S02: Table 'test.t5' doesn't exist +T2.MYD +T2.MYI +T2.frm +T4.MYD +T4.MYI +T4.frm +db.opt +t1.MYD +t1.MYI +t1.frm +t3.MYD +t3.MYI +t3.frm +# Cleanup +drop table t1,T2,t3,T4; +drop database test2; diff --git a/mysql-test/suite/atomic/rename_case.test b/mysql-test/suite/atomic/rename_case.test new file mode 100644 index 00000000..17151094 --- /dev/null +++ b/mysql-test/suite/atomic/rename_case.test @@ -0,0 +1,54 @@ +# +# This tests tries to cover renames with tables in different cases to ensure +# that lower case table names works +# + +create database test2; +let $mysqld_datadir= `select @@datadir`; + +--echo # +--echo # Testing rename error in different places +--echo # + +create table t1 (a int); +create table T2 (b int); +create table t3 (c int); +create table T4 (d int); + +insert into t1 values(1); +insert into T2 values(2); +insert into t3 values(3); +insert into T4 values(4); + +create temporary table tmp1 (a int); +create temporary table tmp2 (b int); +create temporary table tmp3 (c int); +create temporary table tmp4 (d int); + +insert into tmp1 values(11); +insert into tmp2 values(22); +insert into tmp3 values(33); +insert into tmp4 values(44); + +--error ER_TABLE_EXISTS_ERROR +rename table t3 to T4, t1 to t5, T2 to t1, t5 to T2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t3 to T4, T2 to t1, t5 to T2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, T2 to t1, t3 to T4, t5 to T2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, T2 to t1, t5 to T2, t3 to T4; + +--echo # Try failed rename using two databases +--error ER_NO_SUCH_TABLE +rename table test.t1 to test2.t5, test.T2 to test.t1, t5 to test.T2; + +select t1.a+T2.b+t3.c+T4.d from t1,T2,t3,T4; +--error ER_NO_SUCH_TABLE +select * from t5; + +--list_files $mysqld_datadir/test + +--echo # Cleanup +drop table t1,T2,t3,T4; +drop database test2; diff --git a/mysql-test/suite/atomic/rename_combinations.result b/mysql-test/suite/atomic/rename_combinations.result new file mode 100644 index 00000000..c7536ae8 --- /dev/null +++ b/mysql-test/suite/atomic/rename_combinations.result @@ -0,0 +1,157 @@ +create database test2; +# +# Testing rename error in different places +# +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +create table t4 (d int); +insert into t1 values(1); +insert into t2 values(2); +insert into t3 values(3); +insert into t4 values(4); +create temporary table tmp1 (a int); +create temporary table tmp2 (b int); +create temporary table tmp3 (c int); +create temporary table tmp4 (d int); +insert into tmp1 values(11); +insert into tmp2 values(22); +insert into tmp3 values(33); +insert into tmp4 values(44); +rename table t3 to t4, t1 to t5, t2 to t1, t5 to t2; +ERROR 42S01: Table 't4' already exists +rename table t1 to t5, t3 to t4, t2 to t1, t5 to t2; +ERROR 42S01: Table 't4' already exists +rename table t1 to t5, t2 to t1, t3 to t4, t5 to t2; +ERROR 42S01: Table 't4' already exists +rename table t1 to t5, t2 to t1, t5 to t2, t3 to t4; +ERROR 42S01: Table 't4' already exists +# Try failed rename using two databases +rename table test.t1 to test2.t5, test.t2 to test.t1, t5 to test.t2; +ERROR 42S02: Table 'test.t5' doesn't exist +select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4; +t1.a+t2.b+t3.c+t4.d +10 +select * from t5; +ERROR 42S02: Table 'test.t5' doesn't exist +# +# Testing rename error in different places with temporary tables +# +rename table tmp3 to tmp4, tmp1 to t5, tmp2 to tmp1, t5 to tmp1; +ERROR 42S01: Table 'tmp4' already exists +rename table tmp1 to t5, tmp3 to tmp4, tmp2 to tmp1, t5 to tmp1; +ERROR 42S01: Table 'tmp4' already exists +rename table tmp1 to t5, tmp2 to tmp1, tmp3 to tmp4, t5 to tmp1; +ERROR 42S01: Table 'tmp4' already exists +rename table tmp1 to t5, tmp2 to tmp1, t5 to tmp1, tmp3 to tmp4; +ERROR 42S01: Table 'tmp1' already exists +select tmp1.a+tmp2.b+tmp3.c+tmp4.d from tmp1,tmp2,tmp3,tmp4; +tmp1.a+tmp2.b+tmp3.c+tmp4.d +110 +select * from t5; +ERROR 42S02: Table 'test.t5' doesn't exist +# +# Testing combinations of rename normal and temporary tables +# +rename table t1 to t5, t2 to t1, t5 to t2, tmp3 to tmp4, tmp1 to t5, tmp2 to tmp1, t5 to tmp1; +ERROR 42S01: Table 'tmp4' already exists +rename table t1 to t5, t2 to t1, t5 to t2, tmp1 to t5, tmp3 to tmp4, tmp2 to tmp1, t5 to tmp1; +ERROR 42S01: Table 'tmp4' already exists +rename table t1 to t5, t2 to t1, t5 to t2, tmp1 to t5, tmp2 to tmp1, tmp3 to tmp4, t5 to tmp1; +ERROR 42S01: Table 'tmp4' already exists +rename table t1 to t5, t2 to t1, t5 to t2, tmp1 to t5, tmp2 to tmp1, t5 to tmp1, t3 to t4; +ERROR 42S01: Table 'tmp1' already exists +rename table t1 to t5, tmp2 to tmp5, t2 to t1, tmp2 to tmp1, t5 to t2, tmp5 to tmp1, t8 to t9; +ERROR 42S02: Table 'test.tmp2' doesn't exist +select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4; +t1.a+t2.b+t3.c+t4.d +10 +select tmp1.a+tmp2.b+tmp3.c+tmp4.d from tmp1,tmp2,tmp3,tmp4; +tmp1.a+tmp2.b+tmp3.c+tmp4.d +110 +drop table tmp1,tmp2,tmp3,tmp4; +# +# Similar tests with triggers +# +create trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 10; +end if; +end| +create trigger t2_trg before insert on t2 for each row +begin +if isnull(new.b) then +set new.b:= 100; +end if; +end| +create trigger t3_trg before insert on t3 for each row +begin +if isnull(new.c) then +set new.c:= 1000; +end if; +end| +rename table t3 to t4, t1 to t5, t2 to t1, t5 to t2; +ERROR 42S01: Table 't4' already exists +rename table t1 to t5, t3 to t4, t2 to t1, t5 to t2; +ERROR 42S01: Table 't4' already exists +rename table t1 to t5, t2 to t1, t3 to t4, t5 to t2; +ERROR 42S01: Table 't4' already exists +rename table t1 to t5, t2 to t1, t5 to t2, t3 to t4; +ERROR 42S01: Table 't4' already exists +# Test of move table between databases +rename table t4 to test2.t5, t2 to t4, test2.t5 to t2, t1 to test2.t6; +ERROR HY000: Trigger in wrong schema +show triggers; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +t1_trg INSERT t1 begin +if isnull(new.a) then +set new.a:= 10; +end if; +end BEFORE # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +t2_trg INSERT t2 begin +if isnull(new.b) then +set new.b:= 100; +end if; +end BEFORE # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +t3_trg INSERT t3 begin +if isnull(new.c) then +set new.c:= 1000; +end if; +end BEFORE # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4; +t1.a+t2.b+t3.c+t4.d +10 +insert into t1 values(null); +insert into t2 values(null); +insert into t3 values(null); +select (select sum(t1.a) from t1)+ (select sum(t2.b) from t2) + (select sum(t3.c) from t3)+ (select sum(t4.d) from t4); +(select sum(t1.a) from t1)+ (select sum(t2.b) from t2) + (select sum(t3.c) from t3)+ (select sum(t4.d) from t4) +1120 +drop trigger t1_trg; +drop trigger t2_trg; +drop trigger t3_trg; +# +# Test with views +# +create view v1 as select * from t1; +create view v2 as select * from t2; +create view v3 as select * from t3; +create view v4 as select * from t4; +rename table v3 to v4, v1 to t5, v2 to v1, t5 to v2; +ERROR 42S01: Table 'v4' already exists +rename table v1 to t5, v3 to v4, v2 to v1, t5 to v2; +ERROR 42S01: Table 'v4' already exists +rename table v1 to t5, v2 to v1, v3 to v4, t5 to v2; +ERROR 42S01: Table 'v4' already exists +rename table v1 to t5, v2 to v1, t5 to v2, v3 to v4; +ERROR 42S01: Table 'v4' already exists +# Try failed rename using two databases +rename table test.v1 to test.v5, test.v2 to test.v1, test.v3 to test2.v2, non_existing_view to another_non_existing_view; +ERROR HY000: Changing schema from 'test' to 'test2' is not allowed +select (select sum(v1.a) from v1)+ (select sum(v2.b) from v2) + (select sum(v3.c) from v3)+ (select sum(v4.d) from v4); +(select sum(v1.a) from v1)+ (select sum(v2.b) from v2) + (select sum(v3.c) from v3)+ (select sum(v4.d) from v4) +1120 +drop view v1,v2,v3,v4; +drop table t1, t2, t3, t4; +drop database test2; diff --git a/mysql-test/suite/atomic/rename_combinations.test b/mysql-test/suite/atomic/rename_combinations.test new file mode 100644 index 00000000..b0b5074e --- /dev/null +++ b/mysql-test/suite/atomic/rename_combinations.test @@ -0,0 +1,171 @@ +# +# This tests tries cover most of the recovery cases in +# DDL_LOG_RENAME_TABLE_ACTION and do_rename() +# This test does not intend to crash the server +# It's a complement to main.rename +# + +create database test2; + +--echo # +--echo # Testing rename error in different places +--echo # + +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +create table t4 (d int); + +insert into t1 values(1); +insert into t2 values(2); +insert into t3 values(3); +insert into t4 values(4); + +create temporary table tmp1 (a int); +create temporary table tmp2 (b int); +create temporary table tmp3 (c int); +create temporary table tmp4 (d int); + +insert into tmp1 values(11); +insert into tmp2 values(22); +insert into tmp3 values(33); +insert into tmp4 values(44); + +--error ER_TABLE_EXISTS_ERROR +rename table t3 to t4, t1 to t5, t2 to t1, t5 to t2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t3 to t4, t2 to t1, t5 to t2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t3 to t4, t5 to t2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t5 to t2, t3 to t4; + +--echo # Try failed rename using two databases +--error ER_NO_SUCH_TABLE +rename table test.t1 to test2.t5, test.t2 to test.t1, t5 to test.t2; + +select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4; +--error ER_NO_SUCH_TABLE +select * from t5; + +--echo # +--echo # Testing rename error in different places with temporary tables +--echo # + +--error ER_TABLE_EXISTS_ERROR +rename table tmp3 to tmp4, tmp1 to t5, tmp2 to tmp1, t5 to tmp1; +--error ER_TABLE_EXISTS_ERROR +rename table tmp1 to t5, tmp3 to tmp4, tmp2 to tmp1, t5 to tmp1; +--error ER_TABLE_EXISTS_ERROR +rename table tmp1 to t5, tmp2 to tmp1, tmp3 to tmp4, t5 to tmp1; +--error ER_TABLE_EXISTS_ERROR +rename table tmp1 to t5, tmp2 to tmp1, t5 to tmp1, tmp3 to tmp4; + +select tmp1.a+tmp2.b+tmp3.c+tmp4.d from tmp1,tmp2,tmp3,tmp4; +--error ER_NO_SUCH_TABLE +select * from t5; + +--echo # +--echo # Testing combinations of rename normal and temporary tables +--echo # + +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t5 to t2, tmp3 to tmp4, tmp1 to t5, tmp2 to tmp1, t5 to tmp1; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t5 to t2, tmp1 to t5, tmp3 to tmp4, tmp2 to tmp1, t5 to tmp1; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t5 to t2, tmp1 to t5, tmp2 to tmp1, tmp3 to tmp4, t5 to tmp1; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t5 to t2, tmp1 to t5, tmp2 to tmp1, t5 to tmp1, t3 to t4; + +--error ER_NO_SUCH_TABLE +rename table t1 to t5, tmp2 to tmp5, t2 to t1, tmp2 to tmp1, t5 to t2, tmp5 to tmp1, t8 to t9; + +select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4; +select tmp1.a+tmp2.b+tmp3.c+tmp4.d from tmp1,tmp2,tmp3,tmp4; + +drop table tmp1,tmp2,tmp3,tmp4; + +--echo # +--echo # Similar tests with triggers +--echo # + +delimiter |; +create trigger t1_trg before insert on t1 for each row +begin + if isnull(new.a) then + set new.a:= 10; + end if; +end| +create trigger t2_trg before insert on t2 for each row +begin + if isnull(new.b) then + set new.b:= 100; + end if; +end| +create trigger t3_trg before insert on t3 for each row +begin + if isnull(new.c) then + set new.c:= 1000; + end if; +end| + +delimiter ;| + +--error ER_TABLE_EXISTS_ERROR +rename table t3 to t4, t1 to t5, t2 to t1, t5 to t2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t3 to t4, t2 to t1, t5 to t2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t3 to t4, t5 to t2; +--error ER_TABLE_EXISTS_ERROR +rename table t1 to t5, t2 to t1, t5 to t2, t3 to t4; + +--echo # Test of move table between databases +--error ER_TRG_IN_WRONG_SCHEMA +rename table t4 to test2.t5, t2 to t4, test2.t5 to t2, t1 to test2.t6; + +--replace_column 6 # +show triggers; + +select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4; +insert into t1 values(null); +insert into t2 values(null); +insert into t3 values(null); +select (select sum(t1.a) from t1)+ (select sum(t2.b) from t2) + (select sum(t3.c) from t3)+ (select sum(t4.d) from t4); + +drop trigger t1_trg; +drop trigger t2_trg; +drop trigger t3_trg; + +--echo # +--echo # Test with views +--echo # + +create view v1 as select * from t1; +create view v2 as select * from t2; +create view v3 as select * from t3; +create view v4 as select * from t4; + +--error ER_TABLE_EXISTS_ERROR +rename table v3 to v4, v1 to t5, v2 to v1, t5 to v2; +--error ER_TABLE_EXISTS_ERROR +rename table v1 to t5, v3 to v4, v2 to v1, t5 to v2; +--error ER_TABLE_EXISTS_ERROR +rename table v1 to t5, v2 to v1, v3 to v4, t5 to v2; +--error ER_TABLE_EXISTS_ERROR +rename table v1 to t5, v2 to v1, t5 to v2, v3 to v4; + +--echo # Try failed rename using two databases +--error ER_FORBID_SCHEMA_CHANGE +rename table test.v1 to test.v5, test.v2 to test.v1, test.v3 to test2.v2, non_existing_view to another_non_existing_view; + +select (select sum(v1.a) from v1)+ (select sum(v2.b) from v2) + (select sum(v3.c) from v3)+ (select sum(v4.d) from v4); + +drop view v1,v2,v3,v4; + +# +# Clean up +# +drop table t1, t2, t3, t4; +drop database test2; diff --git a/mysql-test/suite/atomic/rename_table.result b/mysql-test/suite/atomic/rename_table.result new file mode 100644 index 00000000..dc98cc81 --- /dev/null +++ b/mysql-test/suite/atomic/rename_table.result @@ -0,0 +1,150 @@ +"engine: myisam crash point: definition_file_after_create position: 1" +"engine: myisam crash point: definition_file_after_create position: 2" +"engine: myisam crash point: definition_file_after_create position: 3" +"engine: myisam crash point: definition_file_after_create position: 4" +"engine: myisam crash point: definition_file_after_create position: 5" +"engine: myisam crash point: ddl_log_rename_before_rename_table position: 1" +"engine: myisam crash point: ddl_log_rename_before_rename_table position: 2" +"engine: myisam crash point: ddl_log_rename_before_rename_table position: 3" +"engine: myisam crash point: ddl_log_rename_before_rename_table position: 4" +"engine: myisam crash point: ddl_log_rename_before_rename_table position: 5" +"engine: myisam crash point: ddl_log_rename_before_phase_trigger position: 1" +"engine: myisam crash point: ddl_log_rename_before_phase_trigger position: 2" +"engine: myisam crash point: ddl_log_rename_before_phase_trigger position: 3" +"engine: myisam crash point: ddl_log_rename_before_phase_trigger position: 4" +"engine: myisam crash point: ddl_log_rename_before_phase_trigger position: 5" +"engine: myisam crash point: ddl_log_rename_before_rename_trigger position: 1" +"engine: myisam crash point: ddl_log_rename_before_rename_trigger position: 2" +"engine: myisam crash point: ddl_log_rename_before_rename_trigger position: 3" +"engine: myisam crash point: ddl_log_rename_before_rename_trigger position: 4" +"engine: myisam crash point: ddl_log_rename_before_rename_trigger position: 5" +"engine: myisam crash point: ddl_log_rename_before_stat_tables position: 1" +"engine: myisam crash point: ddl_log_rename_before_stat_tables position: 2" +"engine: myisam crash point: ddl_log_rename_before_stat_tables position: 3" +"engine: myisam crash point: ddl_log_rename_before_stat_tables position: 4" +"engine: myisam crash point: ddl_log_rename_before_stat_tables position: 5" +"engine: myisam crash point: ddl_log_rename_after_stat_tables position: 1" +"engine: myisam crash point: ddl_log_rename_after_stat_tables position: 2" +"engine: myisam crash point: ddl_log_rename_after_stat_tables position: 3" +"engine: myisam crash point: ddl_log_rename_after_stat_tables position: 4" +"engine: myisam crash point: ddl_log_rename_after_stat_tables position: 5" +"engine: aria crash point: definition_file_after_create position: 1" +"engine: aria crash point: definition_file_after_create position: 2" +"engine: aria crash point: definition_file_after_create position: 3" +"engine: aria crash point: definition_file_after_create position: 4" +"engine: aria crash point: definition_file_after_create position: 5" +"engine: aria crash point: ddl_log_rename_before_rename_table position: 1" +"engine: aria crash point: ddl_log_rename_before_rename_table position: 2" +"engine: aria crash point: ddl_log_rename_before_rename_table position: 3" +"engine: aria crash point: ddl_log_rename_before_rename_table position: 4" +"engine: aria crash point: ddl_log_rename_before_rename_table position: 5" +"engine: aria crash point: ddl_log_rename_before_phase_trigger position: 1" +"engine: aria crash point: ddl_log_rename_before_phase_trigger position: 2" +"engine: aria crash point: ddl_log_rename_before_phase_trigger position: 3" +"engine: aria crash point: ddl_log_rename_before_phase_trigger position: 4" +"engine: aria crash point: ddl_log_rename_before_phase_trigger position: 5" +"engine: aria crash point: ddl_log_rename_before_rename_trigger position: 1" +"engine: aria crash point: ddl_log_rename_before_rename_trigger position: 2" +"engine: aria crash point: ddl_log_rename_before_rename_trigger position: 3" +"engine: aria crash point: ddl_log_rename_before_rename_trigger position: 4" +"engine: aria crash point: ddl_log_rename_before_rename_trigger position: 5" +"engine: aria crash point: ddl_log_rename_before_stat_tables position: 1" +"engine: aria crash point: ddl_log_rename_before_stat_tables position: 2" +"engine: aria crash point: ddl_log_rename_before_stat_tables position: 3" +"engine: aria crash point: ddl_log_rename_before_stat_tables position: 4" +"engine: aria crash point: ddl_log_rename_before_stat_tables position: 5" +"engine: aria crash point: ddl_log_rename_after_stat_tables position: 1" +"engine: aria crash point: ddl_log_rename_after_stat_tables position: 2" +"engine: aria crash point: ddl_log_rename_after_stat_tables position: 3" +"engine: aria crash point: ddl_log_rename_after_stat_tables position: 4" +"engine: aria crash point: ddl_log_rename_after_stat_tables position: 5" +"engine: aria_notrans crash point: definition_file_after_create position: 1" +"engine: aria_notrans crash point: definition_file_after_create position: 2" +"engine: aria_notrans crash point: definition_file_after_create position: 3" +"engine: aria_notrans crash point: definition_file_after_create position: 4" +"engine: aria_notrans crash point: definition_file_after_create position: 5" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_table position: 1" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_table position: 2" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_table position: 3" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_table position: 4" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_table position: 5" +"engine: aria_notrans crash point: ddl_log_rename_before_phase_trigger position: 1" +"engine: aria_notrans crash point: ddl_log_rename_before_phase_trigger position: 2" +"engine: aria_notrans crash point: ddl_log_rename_before_phase_trigger position: 3" +"engine: aria_notrans crash point: ddl_log_rename_before_phase_trigger position: 4" +"engine: aria_notrans crash point: ddl_log_rename_before_phase_trigger position: 5" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_trigger position: 1" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_trigger position: 2" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_trigger position: 3" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_trigger position: 4" +"engine: aria_notrans crash point: ddl_log_rename_before_rename_trigger position: 5" +"engine: aria_notrans crash point: ddl_log_rename_before_stat_tables position: 1" +"engine: aria_notrans crash point: ddl_log_rename_before_stat_tables position: 2" +"engine: aria_notrans crash point: ddl_log_rename_before_stat_tables position: 3" +"engine: aria_notrans crash point: ddl_log_rename_before_stat_tables position: 4" +"engine: aria_notrans crash point: ddl_log_rename_before_stat_tables position: 5" +"engine: aria_notrans crash point: ddl_log_rename_after_stat_tables position: 1" +"engine: aria_notrans crash point: ddl_log_rename_after_stat_tables position: 2" +"engine: aria_notrans crash point: ddl_log_rename_after_stat_tables position: 3" +"engine: aria_notrans crash point: ddl_log_rename_after_stat_tables position: 4" +"engine: aria_notrans crash point: ddl_log_rename_after_stat_tables position: 5" +"engine: innodb crash point: definition_file_after_create position: 1" +"engine: innodb crash point: definition_file_after_create position: 2" +"engine: innodb crash point: definition_file_after_create position: 3" +"engine: innodb crash point: definition_file_after_create position: 4" +"engine: innodb crash point: definition_file_after_create position: 5" +"engine: innodb crash point: ddl_log_rename_before_rename_table position: 1" +"engine: innodb crash point: ddl_log_rename_before_rename_table position: 2" +"engine: innodb crash point: ddl_log_rename_before_rename_table position: 3" +"engine: innodb crash point: ddl_log_rename_before_rename_table position: 4" +"engine: innodb crash point: ddl_log_rename_before_rename_table position: 5" +"engine: innodb crash point: ddl_log_rename_before_phase_trigger position: 1" +"engine: innodb crash point: ddl_log_rename_before_phase_trigger position: 2" +"engine: innodb crash point: ddl_log_rename_before_phase_trigger position: 3" +"engine: innodb crash point: ddl_log_rename_before_phase_trigger position: 4" +"engine: innodb crash point: ddl_log_rename_before_phase_trigger position: 5" +"engine: innodb crash point: ddl_log_rename_before_rename_trigger position: 1" +"engine: innodb crash point: ddl_log_rename_before_rename_trigger position: 2" +"engine: innodb crash point: ddl_log_rename_before_rename_trigger position: 3" +"engine: innodb crash point: ddl_log_rename_before_rename_trigger position: 4" +"engine: innodb crash point: ddl_log_rename_before_rename_trigger position: 5" +"engine: innodb crash point: ddl_log_rename_before_stat_tables position: 1" +"engine: innodb crash point: ddl_log_rename_before_stat_tables position: 2" +"engine: innodb crash point: ddl_log_rename_before_stat_tables position: 3" +"engine: innodb crash point: ddl_log_rename_before_stat_tables position: 4" +"engine: innodb crash point: ddl_log_rename_before_stat_tables position: 5" +"engine: innodb crash point: ddl_log_rename_after_stat_tables position: 1" +"engine: innodb crash point: ddl_log_rename_after_stat_tables position: 2" +"engine: innodb crash point: ddl_log_rename_after_stat_tables position: 3" +"engine: innodb crash point: ddl_log_rename_after_stat_tables position: 4" +"engine: innodb crash point: ddl_log_rename_after_stat_tables position: 5" +"engine: csv crash point: definition_file_after_create position: 1" +"engine: csv crash point: definition_file_after_create position: 2" +"engine: csv crash point: definition_file_after_create position: 3" +"engine: csv crash point: definition_file_after_create position: 4" +"engine: csv crash point: definition_file_after_create position: 5" +"engine: csv crash point: ddl_log_rename_before_rename_table position: 1" +"engine: csv crash point: ddl_log_rename_before_rename_table position: 2" +"engine: csv crash point: ddl_log_rename_before_rename_table position: 3" +"engine: csv crash point: ddl_log_rename_before_rename_table position: 4" +"engine: csv crash point: ddl_log_rename_before_rename_table position: 5" +"engine: csv crash point: ddl_log_rename_before_phase_trigger position: 1" +"engine: csv crash point: ddl_log_rename_before_phase_trigger position: 2" +"engine: csv crash point: ddl_log_rename_before_phase_trigger position: 3" +"engine: csv crash point: ddl_log_rename_before_phase_trigger position: 4" +"engine: csv crash point: ddl_log_rename_before_phase_trigger position: 5" +"engine: csv crash point: ddl_log_rename_before_rename_trigger position: 1" +"engine: csv crash point: ddl_log_rename_before_rename_trigger position: 2" +"engine: csv crash point: ddl_log_rename_before_rename_trigger position: 3" +"engine: csv crash point: ddl_log_rename_before_rename_trigger position: 4" +"engine: csv crash point: ddl_log_rename_before_rename_trigger position: 5" +"engine: csv crash point: ddl_log_rename_before_stat_tables position: 1" +"engine: csv crash point: ddl_log_rename_before_stat_tables position: 2" +"engine: csv crash point: ddl_log_rename_before_stat_tables position: 3" +"engine: csv crash point: ddl_log_rename_before_stat_tables position: 4" +"engine: csv crash point: ddl_log_rename_before_stat_tables position: 5" +"engine: csv crash point: ddl_log_rename_after_stat_tables position: 1" +"engine: csv crash point: ddl_log_rename_after_stat_tables position: 2" +"engine: csv crash point: ddl_log_rename_after_stat_tables position: 3" +"engine: csv crash point: ddl_log_rename_after_stat_tables position: 4" +"engine: csv crash point: ddl_log_rename_after_stat_tables position: 5" diff --git a/mysql-test/suite/atomic/rename_table.test b/mysql-test/suite/atomic/rename_table.test new file mode 100644 index 00000000..ee24d1f0 --- /dev/null +++ b/mysql-test/suite/atomic/rename_table.test @@ -0,0 +1,156 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_csv.inc +--source include/not_valgrind.inc +--source include/not_embedded.inc + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; + +# +# Testing of atomic rename with forced crashes in a lot of different places +# + +let $engine_count=5; +let $engines='myisam','aria','aria_notrans','innodb','csv'; + +let $crash_count=6; +let $crash_points='definition_file_after_create','ddl_log_rename_before_rename_table','ddl_log_rename_before_phase_trigger','ddl_log_rename_before_rename_trigger','ddl_log_rename_before_stat_tables','ddl_log_rename_after_stat_tables'; + +# Number of renames in the tested statement +let $renames=5; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +--disable_query_log +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null) $extra_option; + --eval create table t2 (b int not null) $extra_option; + --eval create table t3 (c int not null) $extra_option; + --eval create table t4 (d int not null) $extra_option; + insert into t1 values(1); + insert into t2 values(2); + insert into t3 values(3); + insert into t4 values(4); + + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + create trigger t2_trg before insert on t2 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + create trigger t3_trg before insert on t3 for each row + begin + if isnull(new.c) then + set new.c:= 4000; + end if; + end| + create trigger t4_trg before insert on t4 for each row + begin + if isnull(new.d) then + set new.d:= 8000; + end if; + end| + delimiter ;| + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $renames) + { + inc $r; + echo "engine: $engine crash point: $crash position: $r"; + flush tables; + + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + # No crash, rename things back + rename table t4 to t3, t5 to t4, t2 to t5, t1 to t2, t5 to t1; + } + + # Ensure that the tables are back to original + let $res=`select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4`; + if ($res != 10) + { + die "Got result $res when 10 was expected"; + } + + # Ensure that triggers work + insert into t1 values(null); + insert into t2 values(null); + insert into t3 values(null); + insert into t4 values(null); + let $res=`select (select sum(t1.a) from t1)+ (select sum(t2.b) from t2) + (select sum(t3.c) from t3)+ (select sum(t4.d) from t4)`; + if ($res != 15010) + { + die "Got result $res when 15010 was expected"; + } + # Restore tables + delete from t1 where a > 100; + delete from t2 where b > 100; + delete from t3 where c > 100; + delete from t4 where d > 100; + } + } + + # Last test, check that rename really worked + rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4; + insert into t1 values(null); + insert into t2 values(null); + insert into t5 values(null); + insert into t4 values(null); + let $res=`select (select sum(t1.b) from t1)+ (select sum(t2.a) from t2) + (select sum(t4.c) from t4)+ (select sum(t5.d) from t5)`; + if ($res != 15010) + { + die "Got result $res when 15010 was expected"; + } + let $res=`select (select count(*)=2 from t1) + (select count(*)=2 from t2) + (select count(*)=2 from t4)+ (select count(*)=2 from t5)`; + if ($res != 4) + { + die "Got result $res when 4 was expected"; + } + + drop table t1,t2,t4,t5; +} +--enable_query_log diff --git a/mysql-test/suite/atomic/rename_table_binlog.result b/mysql-test/suite/atomic/rename_table_binlog.result new file mode 100644 index 00000000..9795b6ef --- /dev/null +++ b/mysql-test/suite/atomic/rename_table_binlog.result @@ -0,0 +1,147 @@ +RESET MASTER; +"engine: myisam crash point: ddl_log_rename_before_binlog position: 1" +"engine: myisam crash point: ddl_log_rename_after_binlog position: 1" +"engine: aria crash point: ddl_log_rename_before_binlog position: 1" +"engine: aria crash point: ddl_log_rename_after_binlog position: 1" +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; insert into t1 values(null) +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; insert into t2 values(null) +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; insert into t3 values(null) +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; insert into t4 values(null) +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; delete from t1 where a > 100 +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; delete from t2 where b > 100 +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; delete from t3 where c > 100 +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Query # # use `test`; delete from t4 where d > 100 +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; flush tables +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t1 values(null) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t2 values(null) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t5 values(null) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t4 values(null) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t4`,`t5` /* generated by server */ +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; create table t1 (a int not null) transactional=1 +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; create table t2 (b int not null) transactional=1 +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; create table t3 (c int not null) transactional=1 +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; create table t4 (d int not null) transactional=1 +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t1 values(1) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t2 values(2) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t3 values(3) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # BEGIN GTID #-#-# +master-bin.000003 # Query # # use `test`; insert into t4 values(4) +master-bin.000003 # Query # # COMMIT +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` trigger t1_trg before insert on t1 for each row +begin +if isnull(new.a) then +set new.a:= 1000; +end if; +end +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` trigger t2_trg before insert on t2 for each row +begin +if isnull(new.b) then +set new.b:= 2000; +end if; +end +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` trigger t3_trg before insert on t3 for each row +begin +if isnull(new.c) then +set new.c:= 4000; +end if; +end +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` trigger t4_trg before insert on t4 for each row +begin +if isnull(new.d) then +set new.d:= 8000; +end if; +end +master-bin.000003 # Gtid # # GTID #-#-# +master-bin.000003 # Query # # use `test`; flush tables +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; insert into t1 values(null) +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; insert into t2 values(null) +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; insert into t3 values(null) +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; insert into t4 values(null) +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; delete from t1 where a > 100 +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; delete from t2 where b > 100 +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; delete from t3 where c > 100 +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # BEGIN GTID #-#-# +master-bin.000004 # Query # # use `test`; delete from t4 where d > 100 +master-bin.000004 # Query # # COMMIT +master-bin.000004 # Gtid # # GTID #-#-# +master-bin.000004 # Query # # use `test`; flush tables +master-bin.000004 # Gtid # # GTID #-#-# +master-bin.000004 # Query # # use `test`; rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000005 # Gtid # # BEGIN GTID #-#-# +master-bin.000005 # Query # # use `test`; insert into t1 values(null) +master-bin.000005 # Query # # COMMIT +master-bin.000005 # Gtid # # BEGIN GTID #-#-# +master-bin.000005 # Query # # use `test`; insert into t2 values(null) +master-bin.000005 # Query # # COMMIT +master-bin.000005 # Gtid # # BEGIN GTID #-#-# +master-bin.000005 # Query # # use `test`; insert into t5 values(null) +master-bin.000005 # Query # # COMMIT +master-bin.000005 # Gtid # # BEGIN GTID #-#-# +master-bin.000005 # Query # # use `test`; insert into t4 values(null) +master-bin.000005 # Query # # COMMIT +master-bin.000005 # Gtid # # GTID #-#-# +master-bin.000005 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t4`,`t5` /* generated by server */ diff --git a/mysql-test/suite/atomic/rename_table_binlog.test b/mysql-test/suite/atomic/rename_table_binlog.test new file mode 100644 index 00000000..bc505148 --- /dev/null +++ b/mysql-test/suite/atomic/rename_table_binlog.test @@ -0,0 +1,170 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_csv.inc +--source include/have_log_bin.inc +--source include/not_valgrind.inc + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; +RESET MASTER; + +# +# Testing of atomic rename with binlogging +# - First crash is before binlog is written, in which case the rename should +# be reverted +# - Second crash is after binlog is written, in which case the rename should hold +# + +let $engine_count=2; +let $engines='myisam', 'aria'; + +let $crash_count=2; +let $crash_points='ddl_log_rename_before_binlog','ddl_log_rename_after_binlog'; +let $crash_positions= 1; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +--disable_query_log +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null) $extra_option; + --eval create table t2 (b int not null) $extra_option; + --eval create table t3 (c int not null) $extra_option; + --eval create table t4 (d int not null) $extra_option; + insert into t1 values(1); + insert into t2 values(2); + insert into t3 values(3); + insert into t4 values(4); + + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + create trigger t2_trg before insert on t2 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + create trigger t3_trg before insert on t3 for each row + begin + if isnull(new.c) then + set new.c:= 4000; + end if; + end| + create trigger t4_trg before insert on t4 for each row + begin + if isnull(new.d) then + set new.d:= 8000; + end if; + end| + delimiter ;| + + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $crash_positions) + { + inc $r; + echo "engine: $engine crash point: $crash position: $r"; + flush tables; + + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 + let $errno=0; + --error 0,2013 + rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + # No crash, rename things back + rename table t4 to t3, t5 to t4, t2 to t5, t1 to t2, t5 to t1; + } + if ($c == 1) + { + # Check that the tables are back to original + let $res=`select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4`; + if ($res != 10) + { + die "Got result $res when 10 was expected"; + } + + # Ensure that triggers work + insert into t1 values(null); + insert into t2 values(null); + insert into t3 values(null); + insert into t4 values(null); + let $res=`select (select sum(t1.a) from t1)+ (select sum(t2.b) from t2) + (select sum(t3.c) from t3)+ (select sum(t4.d) from t4)`; + if ($res != 15010) + { + die "Got result $res when 15010 was expected"; + } + # Restore tables + delete from t1 where a > 100; + delete from t2 where b > 100; + delete from t3 where c > 100; + delete from t4 where d > 100; + } + if ($c == 2) + { + # Check that rename succeded + insert into t1 values(null); + insert into t2 values(null); + insert into t5 values(null); + insert into t4 values(null); + let $res=`select (select sum(t1.b) from t1)+ (select sum(t2.a) from t2) + (select sum(t4.c) from t4)+ (select sum(t5.d) from t5)`; + if ($res != 15010) + { + die "Got result $res when 15010 was expected"; + } + let $res=`select (select count(*)=2 from t1) + (select count(*)=2 from t2) + (select count(*)=2 from t4)+ (select count(*)=2 from t5)`; + if ($res != 4) + { + die "Got result $res when 4 was expected"; + } + } + } + } + drop table t1,t2,t4,t5; +} +--enable_query_log + +# Show the binlogs that holds the renames +--let $binlog_file=master-bin.000002 +--source include/show_binlog_events.inc +--let $binlog_file=master-bin.000003 +--source include/show_binlog_events.inc +--let $binlog_file=master-bin.000004 +--source include/show_binlog_events.inc +--let $binlog_file=master-bin.000005 +--source include/show_binlog_events.inc diff --git a/mysql-test/suite/atomic/rename_trigger.result b/mysql-test/suite/atomic/rename_trigger.result new file mode 100644 index 00000000..d06debda --- /dev/null +++ b/mysql-test/suite/atomic/rename_trigger.result @@ -0,0 +1,150 @@ +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 1" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 2" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 3" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 4" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 5" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 6" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 7" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 8" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 9" +"engine: myisam crash point: ddl_log_rename_after_failed_rename_trigger position: 10" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 1" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 2" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 3" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 4" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 5" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 6" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 7" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 8" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 9" +"engine: myisam crash point: ddl_log_rename_after_revert_rename_table position: 10" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 1" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 2" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 3" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 4" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 5" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 6" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 7" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 8" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 9" +"engine: myisam crash point: ddl_log_rename_after_disable_entry position: 10" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 1" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 2" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 3" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 4" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 5" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 6" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 7" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 8" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 9" +"engine: aria crash point: ddl_log_rename_after_failed_rename_trigger position: 10" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 1" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 2" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 3" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 4" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 5" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 6" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 7" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 8" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 9" +"engine: aria crash point: ddl_log_rename_after_revert_rename_table position: 10" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 1" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 2" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 3" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 4" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 5" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 6" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 7" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 8" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 9" +"engine: aria crash point: ddl_log_rename_after_disable_entry position: 10" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 1" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 2" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 3" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 4" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 5" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 6" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 7" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 8" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 9" +"engine: aria_notrans crash point: ddl_log_rename_after_failed_rename_trigger position: 10" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 1" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 2" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 3" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 4" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 5" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 6" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 7" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 8" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 9" +"engine: aria_notrans crash point: ddl_log_rename_after_revert_rename_table position: 10" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 1" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 2" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 3" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 4" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 5" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 6" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 7" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 8" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 9" +"engine: aria_notrans crash point: ddl_log_rename_after_disable_entry position: 10" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 1" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 2" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 3" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 4" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 5" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 6" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 7" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 8" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 9" +"engine: innodb crash point: ddl_log_rename_after_failed_rename_trigger position: 10" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 1" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 2" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 3" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 4" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 5" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 6" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 7" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 8" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 9" +"engine: innodb crash point: ddl_log_rename_after_revert_rename_table position: 10" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 1" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 2" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 3" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 4" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 5" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 6" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 7" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 8" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 9" +"engine: innodb crash point: ddl_log_rename_after_disable_entry position: 10" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 1" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 2" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 3" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 4" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 5" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 6" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 7" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 8" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 9" +"engine: csv crash point: ddl_log_rename_after_failed_rename_trigger position: 10" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 1" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 2" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 3" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 4" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 5" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 6" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 7" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 8" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 9" +"engine: csv crash point: ddl_log_rename_after_revert_rename_table position: 10" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 1" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 2" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 3" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 4" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 5" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 6" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 7" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 8" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 9" +"engine: csv crash point: ddl_log_rename_after_disable_entry position: 10" diff --git a/mysql-test/suite/atomic/rename_trigger.test b/mysql-test/suite/atomic/rename_trigger.test new file mode 100644 index 00000000..b0b419a3 --- /dev/null +++ b/mysql-test/suite/atomic/rename_trigger.test @@ -0,0 +1,161 @@ +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_csv.inc +--source include/not_valgrind.inc +--source include/not_embedded.inc + +# Speed up wait_until_connected_again.inc +let NO_WSREP=1; + +# +# Testing of atomic rename of table with triggers when table rename works but +# rename of trigger fails. +# This test can't be combined with rename_table.test as we need to simulate +# an error in sql_create_definition_file() +# + +let $crash_count=3; +let $crash_points='ddl_log_rename_after_failed_rename_trigger','ddl_log_rename_after_revert_rename_table', 'ddl_log_rename_after_disable_entry'; + +let $engine_count=5; +let $engines='myisam','aria','aria_notrans','innodb','csv'; + +# Number times sql_create_definition_file() is called during one statement. +# This is number of renames (5)*2 +let $renames=10; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; +--disable_query_log +while ($e < $engine_count) +{ + inc $e; + let $engine=`select ELT($e, $engines)`; + let $default_engine=$engine; + let $extra_option=; + + if ($engine == "aria") + { + let $extra_option=transactional=1; + } + if ($engine == "aria_notrans") + { + let $default_engine="aria"; + let $extra_option=transactional=0; + } + + --eval set @@default_storage_engine=$default_engine + --eval create table t1 (a int not null) $extra_option; + --eval create table t2 (b int not null) $extra_option; + --eval create table t3 (c int not null) $extra_option; + --eval create table t4 (d int not null) $extra_option; + insert into t1 values(1); + insert into t2 values(2); + insert into t3 values(3); + insert into t4 values(4); + + delimiter |; + create trigger t1_trg before insert on t1 for each row + begin + if isnull(new.a) then + set new.a:= 1000; + end if; + end| + create trigger t2_trg before insert on t2 for each row + begin + if isnull(new.b) then + set new.b:= 2000; + end if; + end| + create trigger t3_trg before insert on t3 for each row + begin + if isnull(new.c) then + set new.c:= 4000; + end if; + end| + create trigger t4_trg before insert on t4 for each row + begin + if isnull(new.d) then + set new.d:= 8000; + end if; + end| + delimiter ;| + let $c=0; + while ($c < $crash_count) + { + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $renames) + { + inc $r; + echo "engine: $engine crash point: $crash position: $r"; + flush tables; + + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash,definition_file_simulate_write_error",@debug_crash_counter=1; + --eval set @@debug_dbug="+d,definition_file_simulate_write_error",@debug_error_counter=$r; + let $errno=0; + --error 0,2013 + rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + # No crash, rename things back + rename table t4 to t3, t5 to t4, t2 to t5, t1 to t2, t5 to t1; + } + + # Ensure that the tables are back to original + let $res=`select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4`; + if ($res != 10) + { + die "Got result $res when 10 was expected"; + } + + # Ensure that triggers work + insert into t1 values(null); + insert into t2 values(null); + insert into t3 values(null); + insert into t4 values(null); + let $res=`select (select sum(t1.a) from t1)+ (select sum(t2.b) from t2) + (select sum(t3.c) from t3)+ (select sum(t4.d) from t4)`; + if ($res != 15010) + { + die "Got result $res when 15010 was expected"; + } + # Restore tables + delete from t1 where a > 100; + delete from t2 where b > 100; + delete from t3 where c > 100; + delete from t4 where d > 100; + } + } + + # Last test, check that rename really worked + rename table t1 to t5, t2 to t1, t5 to t2, t4 to t5, t3 to t4; + insert into t1 values(null); + insert into t2 values(null); + insert into t5 values(null); + insert into t4 values(null); + let $res=`select (select sum(t1.b) from t1)+ (select sum(t2.a) from t2) + (select sum(t4.c) from t4)+ (select sum(t5.d) from t5)`; + if ($res != 15010) + { + die "Got result $res when 15010 was expected"; + } + let $res=`select (select count(*)=2 from t1) + (select count(*)=2 from t2) + (select count(*)=2 from t4)+ (select count(*)=2 from t5)`; + if ($res != 4) + { + die "Got result $res when 4 was expected"; + } + + drop table t1,t2,t4,t5; +} +--enable_query_log +--disable_query_log diff --git a/mysql-test/suite/atomic/rename_view.result b/mysql-test/suite/atomic/rename_view.result new file mode 100644 index 00000000..a8a630c5 --- /dev/null +++ b/mysql-test/suite/atomic/rename_view.result @@ -0,0 +1,23 @@ +"engine: crash point: ddl_log_rename_before_rename_view position: 1" +"engine: crash point: ddl_log_rename_before_rename_view position: 2" +"engine: crash point: ddl_log_rename_before_rename_view position: 3" +"engine: crash point: ddl_log_rename_before_rename_view position: 4" +"engine: crash point: ddl_log_rename_before_rename_view position: 5" +"engine: crash point: ddl_log_rename_after_rename_view position: 1" +"engine: crash point: ddl_log_rename_after_rename_view position: 2" +"engine: crash point: ddl_log_rename_after_rename_view position: 3" +"engine: crash point: ddl_log_rename_after_rename_view position: 4" +"engine: crash point: ddl_log_rename_after_rename_view position: 5" +"engine: crash point: rename_view_after_rename_schema_file position: 1" +"engine: crash point: rename_view_after_rename_schema_file position: 2" +"engine: crash point: rename_view_after_rename_schema_file position: 3" +"engine: crash point: rename_view_after_rename_schema_file position: 4" +"engine: crash point: rename_view_after_rename_schema_file position: 5" +"engine: crash point: definition_file_after_create position: 1" +"engine: crash point: definition_file_after_create position: 2" +"engine: crash point: definition_file_after_create position: 3" +"engine: crash point: definition_file_after_create position: 4" +"engine: crash point: definition_file_after_create position: 5" +# +# At last check that rename works when there is no crash +# diff --git a/mysql-test/suite/atomic/rename_view.test b/mysql-test/suite/atomic/rename_view.test new file mode 100644 index 00000000..c326d842 --- /dev/null +++ b/mysql-test/suite/atomic/rename_view.test @@ -0,0 +1,85 @@ +--source include/have_debug.inc +--source include/not_valgrind.inc +--source include/not_embedded.inc + +# +# Testing of atomic rename with crashes in a lot of different places +# + +let $crash_count=4; +let $crash_points='ddl_log_rename_before_rename_view','ddl_log_rename_after_rename_view','rename_view_after_rename_schema_file','definition_file_after_create'; + +# Number of renames in the tested statement +let $renames=5; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; + +--disable_query_log +create table t1 (a int not null); +create table t2 (b int not null); +create table t3 (c int not null); +create table t4 (d int not null); +insert into t1 values(1); +insert into t2 values(2); +insert into t3 values(3); +insert into t4 values(4); +create view v1 as select t1.a from t1; +create view v2 as select t2.b from t2; +create view v3 as select t3.c from t3; +create view v4 as select t4.d from t4; +flush tables; + +let $c=0; +while ($c < $crash_count) +{ + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $renames) + { + inc $r; + echo "engine: crash point: $crash position: $r"; + + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r + let $errno=0; + --error 0,2013 + rename table v1 to v5, v2 to v1, v5 to v2, v4 to v5, v3 to v4; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + # No crash, rename things back + rename table v4 to v3, v5 to v4, v2 to v5, v1 to v2, v5 to v1; + } + + # Ensure that the tables are back to original + let $res=`select v1.a+v2.b+v3.c+v4.d from v1,v2,v3,v4`; + if ($res != 10) + { + die "Got result $res when 10 was expected"; + } + } +} + +--echo # +--echo # At last check that rename works when there is no crash +--echo # + +rename table v1 to v5, v2 to v1, v5 to v2, v4 to v5, v3 to v4; +let $res=`select (select sum(v1.b) from v1)+ (select sum(v2.a) from v2) + (select sum(v4.c) from v4)+ (select sum(v5.d) from v5)`; +if ($res != 10) +{ + die "Got result $res when 10 was expected"; +} +drop view v1,v2,v4,v5; +drop table t1,t2,t3,t4; +--enable_query_log diff --git a/mysql-test/suite/atomic/rename_view2.result b/mysql-test/suite/atomic/rename_view2.result new file mode 100644 index 00000000..8af0320c --- /dev/null +++ b/mysql-test/suite/atomic/rename_view2.result @@ -0,0 +1,8 @@ +"engine: crash point: ddl_log_rename_after_disable_entry position: 1" +"engine: crash point: ddl_log_rename_after_disable_entry position: 2" +"engine: crash point: ddl_log_rename_after_disable_entry position: 3" +"engine: crash point: ddl_log_rename_after_disable_entry position: 4" +"engine: crash point: ddl_log_rename_after_disable_entry position: 5" +# +# At last check that rename works when there is no crash +# diff --git a/mysql-test/suite/atomic/rename_view2.test b/mysql-test/suite/atomic/rename_view2.test new file mode 100644 index 00000000..5dfc72bb --- /dev/null +++ b/mysql-test/suite/atomic/rename_view2.test @@ -0,0 +1,89 @@ +--source include/have_debug.inc +--source include/not_valgrind.inc + +# +# Testing of atomic rename of view when creating of definition file fails +# and we crash after the last rename entry has been disabled. +# This is not possible to test with rename_view.test, which is why +# we have a separate test for this case +# + +let $crash_count=1; +let $crash_points='ddl_log_rename_after_disable_entry'; + +# Number of renames in the tested statement +let $renames=5; + +let $old_debug=`select @@debug_dbug`; + +let $e=0; + +--disable_query_log +create table t1 (a int not null); +create table t2 (b int not null); +create table t3 (c int not null); +create table t4 (d int not null); +insert into t1 values(1); +insert into t2 values(2); +insert into t3 values(3); +insert into t4 values(4); +create view v1 as select t1.a from t1; +create view v2 as select t2.b from t2; +create view v3 as select t3.c from t3; +create view v4 as select t4.d from t4; +flush tables; + +let $c=0; +while ($c < $crash_count) +{ + inc $c; + let $crash=`select ELT($c, $crash_points)`; + let $r=0; + while ($r < $renames) + { + inc $r; + echo "engine: crash point: $crash position: $r"; + + --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --disable_reconnect + --eval set @@debug_dbug="+d,$crash,definition_file_simulate_write_error",@debuge_crash_counter=1; + --eval set @@debug_dbug="+d,definition_file_simulate_write_error",@debug_error_counter=$r; + + let $errno=0; + --error 0,3,2013 + rename table v1 to v5, v2 to v1, v5 to v2, v4 to v5, v3 to v4; + let $error=$errno; + --enable_reconnect + --source include/wait_until_connected_again.inc + --disable_query_log + --eval set @@debug_dbug="$old_debug" + + if ($error == 0) + { + echo "No crash!"; + # No crash, rename things back + rename table v4 to v3, v5 to v4, v2 to v5, v1 to v2, v5 to v1; + } + + # Ensure that the tables are back to original + let $res=`select v1.a+v2.b+v3.c+v4.d from v1,v2,v3,v4`; + if ($res != 10) + { + die "Got result $res when 10 was expected"; + } + } +} + +--echo # +--echo # At last check that rename works when there is no crash +--echo # + +rename table v1 to v5, v2 to v1, v5 to v2, v4 to v5, v3 to v4; +let $res=`select (select sum(v1.b) from v1)+ (select sum(v2.a) from v2) + (select sum(v4.c) from v4)+ (select sum(v5.d) from v5)`; +if ($res != 10) +{ + die "Got result $res when 10 was expected"; +} +drop view v1,v2,v4,v5; +drop table t1,t2,t3,t4; +--enable_query_log |