summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2021-03-18 12:41:08 +0200
committerMonty <monty@mariadb.org>2021-04-08 13:16:06 +0300
commitd9b538a522fdf3513942d90ad54366c13b2699ec (patch)
tree504c7ca8c1bb2337562c70868b5754be65c2f233
parent428d67c254c0ad9b01f2960af538870bf82c45e5 (diff)
downloadmariadb-git-d9b538a522fdf3513942d90ad54366c13b2699ec.tar.gz
MDEV-25180 Atomic ALTER TABLE
The purpose of this task is to ensure that ALTER TABLE is atomic even if the MariaDB server would be killed at any point of the alter table. This means that either the ALTER TABLE succeeds (including that triggers, the status tables and the binary log are updated) or things should be reverted to their original state. If the server crashes before the new version is fully up to date and commited, it will revert to the original table and remove all temporary files and tables. If the new version is commited, crash recovery will use the new version, and update triggers, the status tables and the binary log. The one execption is ALTER TABLE .. RENAME .. where no changes are done to table definition. This one will work as RENAME and roll back unless the whole statement completed, including updating the binary log (if enabled). Other changes: - Added handlerton->check_version() function to allow the ddl recovery code to check, in case of inplace alter table, if the table in the storage engine is of the new or old version. - Added handler->table_version() so that an engine can report the current version of the table. This should be changed each time the table definition changes. - Added function server_uuid_value() to be able to generate a temporary xid when ddl recovery writes the query to the binary log. This is needed to be able to handle crashes during ddl log recovery. - Moved freeing of the frm definition to end of mysql_alter_table() to remove duplicate code and have a common exit strategy. InnoDB part of atomic ALTER TABLE (Implemented by Marko Mäkelä) innodb_check_version(): Compare the saved dict_table_t::def_trx_id to determine whether an ALTER TABLE operation was committed. We must correctly recover dict_table_t::def_trx_id for this to work. Before purge removes any trace of DB_TRX_ID from system tables, it will make an effort to load the user table into the cache, so that the dict_table_t::def_trx_id can be recovered. ha_innobase::table_version(): return garbage, or the trx_id that would be used for committing an ALTER TABLE operation. FIXME: Disabled tests: innodb.instant_alter_crash innodb.alter_crash MyRocks support for atomic ALTER TABLE (Implemented by Sergui Petrunia) Implement these SE API functions: - ha_rocksdb::table_version() - hton->check_version = rocksdb_check_versionMyRocks data dictionary now stores table version for each table. (absence of table version record is interpreted as table_version=0, that is, which means no upgrade changes are needed)
-rw-r--r--mysql-test/include/have_rocksdb.inc4
-rw-r--r--mysql-test/include/have_rocksdb.opt1
-rw-r--r--mysql-test/suite/atomic/alter_table.opt1
-rw-r--r--mysql-test/suite/atomic/alter_table.result2757
-rw-r--r--mysql-test/suite/atomic/alter_table.test182
-rw-r--r--mysql-test/suite/atomic/alter_table_aria.result1541
-rw-r--r--mysql-test/suite/atomic/alter_table_aria.test7
-rw-r--r--mysql-test/suite/atomic/alter_table_big_query.result34
-rw-r--r--mysql-test/suite/atomic/alter_table_big_query.test109
-rw-r--r--mysql-test/suite/atomic/alter_table_rocksdb.result1670
-rw-r--r--mysql-test/suite/atomic/alter_table_rocksdb.test6
-rw-r--r--mysql-test/suite/atomic/alter_table_trigger.result131
-rw-r--r--mysql-test/suite/atomic/alter_table_trigger.test140
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-alter.test4
-rw-r--r--mysql-test/suite/innodb/r/alter_copy.result5
-rw-r--r--mysql-test/suite/innodb/r/alter_foreign_crash.result9
-rw-r--r--mysql-test/suite/innodb/t/alter_copy.test9
-rw-r--r--mysql-test/suite/innodb/t/alter_crash.test28
-rw-r--r--mysql-test/suite/innodb/t/alter_foreign_crash.test5
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_crash.test1
-rw-r--r--sql/ddl_log.cc961
-rw-r--r--sql/ddl_log.h59
-rw-r--r--sql/handler.h36
-rw-r--r--sql/item_func.cc10
-rw-r--r--sql/item_func.h1
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/sql_partition.cc3
-rw-r--r--sql/sql_table.cc282
-rw-r--r--storage/innobase/dict/dict0crea.cc6
-rw-r--r--storage/innobase/dict/dict0load.cc53
-rw-r--r--storage/innobase/handler/ha_innodb.cc36
-rw-r--r--storage/innobase/handler/ha_innodb.h4
-rw-r--r--storage/innobase/handler/handler0alter.cc74
-rw-r--r--storage/innobase/handler/i_s.cc13
-rw-r--r--storage/innobase/include/dict0mem.h26
-rw-r--r--storage/innobase/include/trx0trx.h5
-rw-r--r--storage/innobase/row/row0merge.cc9
-rw-r--r--storage/innobase/row/row0mysql.cc1
-rw-r--r--storage/innobase/row/row0purge.cc84
-rw-r--r--storage/innobase/row/row0uins.cc3
-rw-r--r--storage/innobase/row/row0umod.cc34
-rw-r--r--storage/innobase/trx/trx0trx.cc11
-rw-r--r--storage/rocksdb/ha_rocksdb.cc100
-rw-r--r--storage/rocksdb/ha_rocksdb.h3
44 files changed, 8115 insertions, 345 deletions
diff --git a/mysql-test/include/have_rocksdb.inc b/mysql-test/include/have_rocksdb.inc
new file mode 100644
index 00000000000..bc6ec648605
--- /dev/null
+++ b/mysql-test/include/have_rocksdb.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'ROCKSDB' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires MyRocks engine
+}
diff --git a/mysql-test/include/have_rocksdb.opt b/mysql-test/include/have_rocksdb.opt
new file mode 100644
index 00000000000..df675545bf9
--- /dev/null
+++ b/mysql-test/include/have_rocksdb.opt
@@ -0,0 +1 @@
+--plugin-load=$HA_ROCKSDB_SO
diff --git a/mysql-test/suite/atomic/alter_table.opt b/mysql-test/suite/atomic/alter_table.opt
new file mode 100644
index 00000000000..61f3ce08d27
--- /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 00000000000..73fcfaddcf6
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_table.result
@@ -0,0 +1,2757 @@
+create database test2;
+
+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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # 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,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"No crash!"
+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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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
+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
+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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"No crash!"
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"No crash!"
+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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # ALTER TABLE t1 ADD key(b), COMMENT "new"
+
+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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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
+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
+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
+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 COMMENT='new'
+count(*)
+0
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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
+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
+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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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!"
diff --git a/mysql-test/suite/atomic/alter_table.test b/mysql-test/suite/atomic/alter_table.test
new file mode 100644
index 00000000000..f36ef4b7445
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_table.test
@@ -0,0 +1,182 @@
+--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");
+--enable_query_log
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+create database test2;
+
+if ($engine_count == "")
+{
+ let $engine_count=2;
+ let $engines='myisam','innodb';
+}
+if ($extra_engine == "")
+{
+ let $extra_engine=aria;
+}
+
+let $crash_count=12;
+let $crash_points='ddl_log_alter_after_create_frm', 'ddl_log_alter_after_create_table', '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=15;
+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"';
+
+# 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;
+
+ RESET MASTER;
+ --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=master-bin.000001
+ --source include/show_binlog_events.inc
+ if ($error)
+ {
+ --let $binlog_file=master-bin.000002
+ --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 00000000000..bfff5f4db44
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_table_aria.result
@@ -0,0 +1,1541 @@
+create database test2;
+
+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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"No crash!"
+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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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 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 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 PAGE_CHECKSUM=1
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"No crash!"
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"No crash!"
+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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 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 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 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+crash point: ddl_log_alter_after_create_table
+"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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 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 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 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # ALTER TABLE t1 ADD key(b), COMMENT "new"
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 00000000000..6bf44b0463d
--- /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 00000000000..3e743c2794c
--- /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, COM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table_big_query.test b/mysql-test/suite/atomic/alter_table_big_query.test
new file mode 100644
index 00000000000..6248d4371a0
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_table_big_query.test
@@ -0,0 +1,109 @@
+--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");
+--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;
+
+ RESET MASTER;
+ --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=master-bin.000001
+ --source include/show_binlog_events.inc
+ if ($error)
+ {
+ --let $binlog_file=master-bin.000002
+ --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 00000000000..ba55d282ad4
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_table_rocksdb.result
@@ -0,0 +1,1670 @@
+set global rocksdb_flush_log_at_trx_commit=1;
+create database test2;
+
+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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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_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
+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
+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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 PAGE_CHECKSUM=1 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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
+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
+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
+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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+master-bin.000002 # Query # # ALTER TABLE t1 ADD key(b), COMMENT "new"
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 00000000000..fa34008dd58
--- /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 00000000000..212fda9f65c
--- /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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 COMMENT='new'
+count(*)
+2
+sum(a)
+1003
+master-bin.000002 # Query # # 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 00000000000..276da893483
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_table_trigger.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
+#
+# 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");
+--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 ;|
+
+ RESET MASTER;
+ --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=master-bin.000001
+ --source include/show_binlog_events.inc
+ if ($error)
+ {
+ --let $binlog_file=master-bin.000002
+ --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/encryption/t/innodb-encryption-alter.test b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
index f0177b2ca4e..6e5d449b10a 100644
--- a/mysql-test/suite/encryption/t/innodb-encryption-alter.test
+++ b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
@@ -131,7 +131,3 @@ disconnect con1;
select * from t1;
drop table t1,t2;
-
-# Work around missing crash recovery at the SQL layer.
-let $datadir= `select @@datadir`;
---remove_files_wildcard $datadir/test #sql-*.frm
diff --git a/mysql-test/suite/innodb/r/alter_copy.result b/mysql-test/suite/innodb/r/alter_copy.result
index 9b8f04eacca..5fdcf2005df 100644
--- a/mysql-test/suite/innodb/r/alter_copy.result
+++ b/mysql-test/suite/innodb/r/alter_copy.result
@@ -53,8 +53,6 @@ connection default;
SET DEBUG_SYNC='now WAIT_FOR hung';
# restart: --innodb-force-recovery=3
disconnect hang;
-#sql-alter.frm
-#sql-alter.ibd
FTS_INDEX_1.ibd
FTS_INDEX_2.ibd
FTS_INDEX_3.ibd
@@ -122,8 +120,6 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
# restart: --innodb-read-only
-#sql-alter.frm
-#sql-alter.ibd
FTS_INDEX_1.ibd
FTS_INDEX_2.ibd
FTS_INDEX_3.ibd
@@ -191,7 +187,6 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
# restart
-#sql-alter.frm
FTS_INDEX_1.ibd
FTS_INDEX_2.ibd
FTS_INDEX_3.ibd
diff --git a/mysql-test/suite/innodb/r/alter_foreign_crash.result b/mysql-test/suite/innodb/r/alter_foreign_crash.result
index 9a7a23a5b72..42bba3f289d 100644
--- a/mysql-test/suite/innodb/r/alter_foreign_crash.result
+++ b/mysql-test/suite/innodb/r/alter_foreign_crash.result
@@ -19,9 +19,14 @@ SET DEBUG_SYNC='now SIGNAL s2 WAIT_FOR s1';
disconnect con1;
show tables;
Tables_in_bug
+child
parent
alter table parent row_format=dynamic;
-Warnings:
-Warning 1088 failed to load FOREIGN KEY constraints
+select * from child;
+a
+1
+drop table parent;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+drop table child;
drop table parent;
drop database bug;
diff --git a/mysql-test/suite/innodb/t/alter_copy.test b/mysql-test/suite/innodb/t/alter_copy.test
index de2f99b68d4..6b6a0151de4 100644
--- a/mysql-test/suite/innodb/t/alter_copy.test
+++ b/mysql-test/suite/innodb/t/alter_copy.test
@@ -63,7 +63,7 @@ let $shutdown_timeout=0;
disconnect hang;
let $shutdown_timeout=;
let $datadir=`select @@datadir`;
---replace_regex /#sql-alter-[0-9a-f_\-]*/#sql-alter/ /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
+--replace_regex /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
--list_files $datadir/test
SHOW CREATE TABLE t;
SELECT COUNT(*) FROM t;
@@ -76,7 +76,7 @@ CHECK TABLE t1;
--let $restart_parameters= --innodb-read-only
--source include/restart_mysqld.inc
---replace_regex /#sql-alter-[0-9a-f_\-]*/#sql-alter/ /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
+--replace_regex /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
--list_files $datadir/test
SHOW CREATE TABLE t;
@@ -90,9 +90,6 @@ CHECK TABLE t1;
--let $restart_parameters=
--source include/restart_mysqld.inc
---replace_regex /#sql-alter-[0-9a-f_\-]*/#sql-alter/ /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
+--replace_regex /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
--list_files $datadir/test
DROP TABLE t1,t;
-
-# Work around missing crash recovery at the SQL layer.
---remove_files_wildcard $datadir/test #sql-*.frm
diff --git a/mysql-test/suite/innodb/t/alter_crash.test b/mysql-test/suite/innodb/t/alter_crash.test
index 72116b0ca9d..ea2716b9111 100644
--- a/mysql-test/suite/innodb/t/alter_crash.test
+++ b/mysql-test/suite/innodb/t/alter_crash.test
@@ -74,19 +74,6 @@ let $orig_table_id = `SELECT table_id
--error 2013
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
-let TABLENAME_INC= $MYSQLTEST_VARDIR/tmp/tablename.inc;
-perl;
-die unless open OUT, ">$ENV{TABLENAME_INC}";
-chdir "$ENV{'datadir'}/test";
-my @frm_file = map { substr($_, 0, -4) } glob "#sql-*.frm";
-print OUT 'let $tablename=', $frm_file[0], ';';
-close OUT or die;
-EOF
-source $TABLENAME_INC;
-remove_file $TABLENAME_INC;
-
-move_file $datadir/test/$tablename.frm $datadir/test/t1.frm;
-
--echo # Restart mysqld after the crash and reconnect.
--source include/start_mysqld.inc
@@ -127,8 +114,6 @@ let $orig_table_id = `SELECT table_id
--error 2013
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
-remove_files_wildcard $datadir/test #sql-*.frm;
-
--echo # Startup the server after the crash
--source include/start_mysqld.inc
@@ -169,18 +154,6 @@ let $orig_table_id = `select table_id from
--error 2013
ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE;
-perl;
-die unless open OUT, ">$ENV{TABLENAME_INC}";
-chdir "$ENV{'datadir'}/test";
-my @frm_file = map { substr($_, 0, -4) } glob "#sql-*.frm";
-print OUT 'let $tablename=', $frm_file[0], ';';
-close OUT or die;
-EOF
-source $TABLENAME_INC;
-remove_file $TABLENAME_INC;
-
-move_file $datadir/test/$tablename.frm $datadir/test/t1.frm;
-
--echo # Restart mysqld after the crash and reconnect.
--source include/start_mysqld.inc
@@ -188,7 +161,6 @@ move_file $datadir/test/$tablename.frm $datadir/test/t1.frm;
eval SELECT * FROM information_schema.innodb_sys_tables
WHERE table_id = $orig_table_id;
---echo # Files in datadir after manual recovery.
--list_files $MYSQLD_DATADIR/test
SHOW TABLES;
diff --git a/mysql-test/suite/innodb/t/alter_foreign_crash.test b/mysql-test/suite/innodb/t/alter_foreign_crash.test
index 1952a1b30d4..e2a6c301bf7 100644
--- a/mysql-test/suite/innodb/t/alter_foreign_crash.test
+++ b/mysql-test/suite/innodb/t/alter_foreign_crash.test
@@ -32,6 +32,9 @@ disconnect con1;
show tables;
alter table parent row_format=dynamic;
-
+select * from child;
+--error ER_ROW_IS_REFERENCED_2
+drop table parent;
+drop table child;
drop table parent;
drop database bug;
diff --git a/mysql-test/suite/innodb/t/instant_alter_crash.test b/mysql-test/suite/innodb/t/instant_alter_crash.test
index 43db8f619f3..2a596342530 100644
--- a/mysql-test/suite/innodb/t/instant_alter_crash.test
+++ b/mysql-test/suite/innodb/t/instant_alter_crash.test
@@ -203,5 +203,4 @@ SHOW CREATE TABLE t2;
SHOW CREATE TABLE t3;
DROP TABLE t1,t2,t3;
---remove_files_wildcard $MYSQLD_DATADIR/test #sql*.frm
--list_files $MYSQLD_DATADIR/test
diff --git a/sql/ddl_log.cc b/sql/ddl_log.cc
index 46ce36a469d..dd20fc2dd46 100644
--- a/sql/ddl_log.cc
+++ b/sql/ddl_log.cc
@@ -90,7 +90,7 @@ const char *ddl_log_action_name[DDL_LOG_LAST_ACTION]=
"rename table", "rename view",
"initialize drop table", "drop table",
"drop view", "drop trigger", "drop db", "create table", "create view",
- "delete tmp file", "create trigger",
+ "delete tmp file", "create trigger", "alter table", "store query"
};
/* Number of phases per entry */
@@ -101,6 +101,7 @@ const uchar ddl_log_entry_phases[DDL_LOG_LAST_ACTION]=
(uchar) DDL_DROP_PHASE_END, 1, 1,
(uchar) DDL_DROP_DB_PHASE_END, (uchar) DDL_CREATE_TABLE_PHASE_END,
(uchar) DDL_CREATE_VIEW_PHASE_END, 0, (uchar) DDL_CREATE_TRIGGER_PHASE_END,
+ DDL_ALTER_TABLE_PHASE_END, 1
};
@@ -117,13 +118,20 @@ struct st_global_ddl_log
bool open;
};
-/* The following structure is only used during startup recovery */
+/*
+ The following structure is only used during startup recovery
+ for writing queries to the binary log.
+ */
+
class st_ddl_recovery {
public:
String drop_table;
String drop_view;
+ String query;
size_t drop_table_init_length, drop_view_init_length;
char current_db[NAME_LEN];
+ uint execute_entry_pos;
+ ulonglong xid;
};
static st_global_ddl_log global_ddl_log;
@@ -297,6 +305,7 @@ static bool write_ddl_log_file_entry(uint entry_pos)
static bool update_phase(uint entry_pos, uchar phase)
{
DBUG_ENTER("update_phase");
+ DBUG_PRINT("enter", ("phase: %d", (int) phase));
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, &phase, 1,
global_ddl_log.io_size * entry_pos +
@@ -306,6 +315,25 @@ static bool update_phase(uint entry_pos, uchar phase)
}
+/*
+ Update flags in ddl log entry
+
+ This is not synced as it usually followed by a phase change, which will sync.
+*/
+
+static bool update_flags(uint entry_pos, uint16 flags)
+{
+ uchar buff[2];
+ DBUG_ENTER("update_flags");
+
+ int2store(buff, flags);
+ DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, sizeof(buff),
+ global_ddl_log.io_size * entry_pos +
+ DDL_LOG_FLAG_POS,
+ MYF(MY_WME | MY_NABP)));
+}
+
+
static bool update_next_entry_pos(uint entry_pos, uint next_entry)
{
uchar buff[4];
@@ -325,7 +353,7 @@ static bool update_xid(uint entry_pos, ulonglong xid)
DBUG_ENTER("update_xid");
int8store(buff, xid);
- DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, 8,
+ DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, sizeof(buff),
global_ddl_log.io_size * entry_pos +
DDL_LOG_XID_POS,
MYF(MY_WME | MY_NABP)) ||
@@ -561,6 +589,7 @@ static void set_global_from_ddl_log_entry(const DDL_LOG_ENTRY *ddl_log_entry)
pos= store_string(pos, end, &ddl_log_entry->from_db);
pos= store_string(pos, end, &ddl_log_entry->from_name);
pos= store_string(pos, end, &ddl_log_entry->tmp_name);
+ pos= store_string(pos, end, &ddl_log_entry->extra_name);
bzero(pos, global_ddl_log.io_size - (pos - file_entry_buf));
}
@@ -582,6 +611,7 @@ static size_t ddl_log_free_space_in_entry(const DDL_LOG_ENTRY *ddl_log_entry)
length+= ddl_log_entry->from_db.length;
length+= ddl_log_entry->from_name.length;
length+= ddl_log_entry->tmp_name.length;
+ length+= ddl_log_entry->extra_name.length;
return global_ddl_log.io_size - length - 3; // 3 is for storing next string
}
@@ -623,6 +653,7 @@ static void set_ddl_log_entry_from_global(DDL_LOG_ENTRY *ddl_log_entry,
ddl_log_entry->from_db= get_string(&pos, end);
ddl_log_entry->from_name= get_string(&pos, end);
ddl_log_entry->tmp_name= get_string(&pos, end);
+ ddl_log_entry->extra_name= get_string(&pos, end);
}
@@ -820,6 +851,19 @@ static bool ddl_log_increment_phase_no_lock(uint entry_pos)
/*
+ Increment phase and sync ddl log. This expects LOCK_gdl to be locked
+*/
+
+static bool increment_phase(uint entry_pos)
+{
+ if (ddl_log_increment_phase_no_lock(entry_pos))
+ return 1;
+ ddl_log_sync_no_lock();
+ return 0;
+}
+
+
+/*
Ignore errors from the file system about:
- Non existing tables or file (from drop table or delete file)
- Error about tables files that already exists.
@@ -937,7 +981,7 @@ static void ddl_log_to_binary_log(THD *thd, String *query)
static bool ddl_log_drop_to_binary_log(THD *thd, DDL_LOG_ENTRY *ddl_log_entry,
String *query)
{
- DBUG_ENTER("ddl_log_binary_log");
+ DBUG_ENTER("ddl_log_drop_to_binary_log");
if (mysql_bin_log.is_open())
{
if (!ddl_log_entry->next_entry ||
@@ -962,6 +1006,235 @@ static bool ddl_log_drop_to_binary_log(THD *thd, DDL_LOG_ENTRY *ddl_log_entry,
DBUG_RETURN(0);
}
+/*
+ Create a new handler based on handlerton name
+*/
+
+static handler *create_handler(THD *thd, MEM_ROOT *mem_root,
+ LEX_CSTRING *name)
+{
+ handlerton *hton;
+ handler *file;
+ plugin_ref plugin= my_plugin_lock_by_name(thd, name,
+ MYSQL_STORAGE_ENGINE_PLUGIN);
+ if (!plugin)
+ {
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(ME_ERROR_LOG), name->str);
+ return 0;
+ }
+ hton= plugin_hton(plugin);
+ if (!ha_storage_engine_is_enabled(hton))
+ {
+ my_error(ER_STORAGE_ENGINE_DISABLED, MYF(ME_ERROR_LOG), name->str);
+ return 0;
+ }
+ if ((file= hton->create(hton, (TABLE_SHARE*) 0, mem_root)))
+ file->init();
+ return file;
+}
+
+
+/*
+ Rename a table and its .frm file for a ddl_log_entry
+
+ We first rename the table and then the .frm file as some engines,
+ like connect, needs the .frm file to exists to be able to do an rename.
+*/
+
+static void execute_rename_table(DDL_LOG_ENTRY *ddl_log_entry, handler *file,
+ const LEX_CSTRING *from_db,
+ const LEX_CSTRING *from_table,
+ const LEX_CSTRING *to_db,
+ const LEX_CSTRING *to_table,
+ uint flags,
+ char *from_path, char *to_path)
+{
+ uint to_length=0, fr_length=0;
+ DBUG_ENTER("execute_rename_table");
+
+ if (file->needs_lower_case_filenames())
+ {
+ build_lower_case_table_filename(from_path, FN_REFLEN,
+ from_db, from_table,
+ flags & FN_FROM_IS_TMP);
+ build_lower_case_table_filename(to_path, FN_REFLEN,
+ to_db, to_table, flags & FN_TO_IS_TMP);
+ }
+ else
+ {
+ fr_length= build_table_filename(from_path, FN_REFLEN,
+ from_db->str, from_table->str, "",
+ flags & FN_TO_IS_TMP);
+ to_length= build_table_filename(to_path, FN_REFLEN,
+ to_db->str, to_table->str, "",
+ flags & FN_TO_IS_TMP);
+ }
+ file->ha_rename_table(from_path, to_path);
+ if (file->needs_lower_case_filenames())
+ {
+ /*
+ We have to rebuild the file names as the .frm file should be used
+ without lower case conversion
+ */
+ fr_length= build_table_filename(from_path, FN_REFLEN,
+ from_db->str, from_table->str, reg_ext,
+ flags & FN_FROM_IS_TMP);
+ to_length= build_table_filename(to_path, FN_REFLEN,
+ to_db->str, to_table->str, reg_ext,
+ flags & FN_TO_IS_TMP);
+ }
+ else
+ {
+ strmov(from_path+fr_length, reg_ext);
+ strmov(to_path+to_length, reg_ext);
+ }
+ if (!access(from_path, F_OK))
+ (void) mysql_file_rename(key_file_frm, from_path, to_path, MYF(MY_WME));
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Update triggers
+
+ If swap_tables == 0 (Restoring the original in case of failed rename)
+ Convert triggers for db.name -> from_db.from_name
+ else (Doing the rename in case of ALTER TABLE ... RENAME)
+ Convert triggers for from_db.from_name -> db.extra_name
+*/
+
+static void rename_triggers(THD *thd, DDL_LOG_ENTRY *ddl_log_entry,
+ bool swap_tables)
+{
+ LEX_CSTRING to_table, from_table, to_db, from_db, from_converted_name;
+ char to_path[FN_REFLEN+1], from_path[FN_REFLEN+1], conv_path[FN_REFLEN+1];
+
+ if (!swap_tables)
+ {
+ from_db= ddl_log_entry->db;
+ from_table= ddl_log_entry->name;
+ to_db= ddl_log_entry->from_db;
+ to_table= ddl_log_entry->from_name;
+ }
+ else
+ {
+ from_db= ddl_log_entry->from_db;
+ from_table= ddl_log_entry->from_name;
+ to_db= ddl_log_entry->db;
+ to_table= ddl_log_entry->extra_name;
+ }
+
+ build_filename_and_delete_tmp_file(from_path, sizeof(from_path),
+ &from_db, &from_table,
+ TRG_EXT, key_file_trg);
+ build_filename_and_delete_tmp_file(to_path, sizeof(to_path),
+ &to_db, &to_table,
+ TRG_EXT, key_file_trg);
+ if (lower_case_table_names)
+ {
+ uint errors;
+ from_converted_name.str= conv_path;
+ from_converted_name.length=
+ strconvert(system_charset_info, from_table.str, from_table.length,
+ files_charset_info, conv_path, FN_REFLEN, &errors);
+ }
+ else
+ from_converted_name= from_table;
+
+ if (!access(to_path, F_OK))
+ {
+ /*
+ The original file was never renamed or we crashed in recovery
+ just after renaming back the file.
+ In this case the current file is correct and we can remove any
+ left over copied files
+ */
+ (void) mysql_file_delete(key_file_trg, from_path, MYF(0));
+ }
+ else if (!access(from_path, F_OK))
+ {
+ /* .TRG file was renamed. Rename it back */
+ /*
+ We have to create a MDL lock as change_table_names() checks that we
+ have a mdl locks for the table
+ */
+ MDL_request mdl_request;
+ TRIGGER_RENAME_PARAM trigger_param;
+ int error __attribute__((unused));
+ MDL_REQUEST_INIT(&mdl_request, MDL_key::TABLE,
+ from_db.str,
+ from_converted_name.str,
+ MDL_EXCLUSIVE, MDL_EXPLICIT);
+ error= thd->mdl_context.acquire_lock(&mdl_request, 1);
+ /* acquire_locks() should never fail during recovery */
+ DBUG_ASSERT(error == 0);
+
+ (void) Table_triggers_list::prepare_for_rename(thd,
+ &trigger_param,
+ &from_db,
+ &from_table,
+ &from_converted_name,
+ &to_db,
+ &to_table);
+ (void) Table_triggers_list::change_table_name(thd,
+ &trigger_param,
+ &from_db,
+ &from_table,
+ &from_converted_name,
+ &to_db,
+ &to_table);
+ thd->mdl_context.release_lock(mdl_request.ticket);
+ }
+}
+
+
+/*
+ Update stat tables
+
+ If swap_tables == 0
+ Convert stats for from_db.from_table -> db.name
+ else
+ Convert stats for db.name -> from_db.from_table
+*/
+
+static void rename_in_stat_tables(THD *thd, DDL_LOG_ENTRY *ddl_log_entry,
+ bool swap_tables)
+{
+ LEX_CSTRING from_table, to_table, from_db, to_db, from_converted_name;
+ char conv_path[FN_REFLEN+1];
+
+ if (!swap_tables)
+ {
+ from_db= ddl_log_entry->db;
+ from_table= ddl_log_entry->name;
+ to_db= ddl_log_entry->from_db;
+ to_table= ddl_log_entry->from_name;
+ }
+ else
+ {
+ from_db= ddl_log_entry->from_db;
+ from_table= ddl_log_entry->from_name;
+ to_db= ddl_log_entry->db;
+ to_table= ddl_log_entry->extra_name;
+ }
+ if (lower_case_table_names)
+ {
+ uint errors;
+ from_converted_name.str= conv_path;
+ from_converted_name.length=
+ strconvert(system_charset_info, from_table.str, from_table.length,
+ files_charset_info, conv_path, FN_REFLEN, &errors);
+ }
+ else
+ from_converted_name= from_table;
+
+ (void) rename_table_in_stat_tables(thd,
+ &from_db,
+ &from_converted_name,
+ &to_db,
+ &to_table);
+}
+
/**
Execute one action in a ddl log entry
@@ -1011,17 +1284,9 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
frm_action= TRUE;
else if (ddl_log_entry->handler_name.length)
{
- plugin_ref plugin= my_plugin_lock_by_name(thd, &handler_name,
- MYSQL_STORAGE_ENGINE_PLUGIN);
- if (!plugin)
- {
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), ddl_log_entry->handler_name);
- goto end;
- }
- hton= plugin_hton(plugin);
- file= get_new_handler((TABLE_SHARE*)0, mem_root, hton);
- if (unlikely(!file))
+ if (!(file= create_handler(thd, mem_root, &handler_name)))
goto end;
+ hton= file->ht;
}
switch (ddl_log_entry->action_type) {
@@ -1051,9 +1316,8 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
break;
}
}
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
- (void) ddl_log_sync_no_lock();
error= 0;
if (ddl_log_entry->action_type == DDL_LOG_DELETE_ACTION)
break;
@@ -1084,9 +1348,8 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
else
(void) file->ha_rename_table(ddl_log_entry->from_name.str,
ddl_log_entry->name.str);
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
- (void) ddl_log_sync_no_lock();
break;
}
case DDL_LOG_EXCHANGE_ACTION:
@@ -1137,130 +1400,35 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
/*
We should restore things by renaming from
'entry->name' to 'entry->from_name'
-
- In the following code 'to_' stands for what the table was renamed to
- that we have to rename back.
*/
- size_t fr_length, to_length;
- LEX_CSTRING from_table, to_table, to_converted_name;
- from_table= ddl_log_entry->from_name;
- to_table= ddl_log_entry->name;
-
- /* Some functions wants to have the lower case table name as an argument */
- if (lower_case_table_names)
- {
- uint errors;
- to_converted_name.str= to_path;
- to_converted_name.length=
- strconvert(system_charset_info, to_table.str, to_table.length,
- files_charset_info, from_path, FN_REFLEN, &errors);
- }
- else
- to_converted_name= to_table;
-
switch (ddl_log_entry->phase) {
case DDL_RENAME_PHASE_TRIGGER:
- {
- MDL_request mdl_request;
- TRIGGER_RENAME_PARAM trigger_param;
-
- build_filename_and_delete_tmp_file(to_path, sizeof(to_path),
- &ddl_log_entry->db,
- &ddl_log_entry->name,
- TRG_EXT,
- key_file_trg);
- build_filename_and_delete_tmp_file(from_path, sizeof(from_path),
- &ddl_log_entry->from_db,
- &ddl_log_entry->from_name,
- TRG_EXT, key_file_trg);
-
- if (!access(from_path, F_OK))
- {
- /*
- The original file was never renamed or we crashed in recovery
- just after renaming back the file.
- In this case the current file is correct and we can remove any
- left over copied files
- */
- (void) mysql_file_delete(key_file_trg, to_path, MYF(0));
- }
- else if (!access(to_path, F_OK))
- {
- /* .TRG file was renamed. Rename it back */
- /*
- We have to create a MDL lock as change_table_names() checks that we
- have a mdl locks for the table
- */
- MDL_REQUEST_INIT(&mdl_request, MDL_key::TABLE,
- ddl_log_entry->db.str,
- to_converted_name.str,
- MDL_EXCLUSIVE, MDL_EXPLICIT);
- error= thd->mdl_context.acquire_lock(&mdl_request, 1);
- /* acquire_locks() should never fail during recovery */
- DBUG_ASSERT(error == 0);
- (void) Table_triggers_list::prepare_for_rename(thd,
- &trigger_param,
- &ddl_log_entry->db,
- &to_table,
- &to_converted_name,
- &ddl_log_entry->from_db,
- &from_table);
- (void) Table_triggers_list::change_table_name(thd,
- &trigger_param,
- &ddl_log_entry->db,
- &to_table,
- &to_converted_name,
- &ddl_log_entry->from_db,
- &from_table);
- thd->mdl_context.release_lock(mdl_request.ticket);
- }
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ rename_triggers(thd, ddl_log_entry, 0);
+ if (increment_phase(entry_pos))
break;
- (void) ddl_log_sync_no_lock();
- }
/* fall through */
case DDL_RENAME_PHASE_STAT:
- {
- (void) rename_table_in_stat_tables(thd,
- &ddl_log_entry->db,
- &to_converted_name,
- &ddl_log_entry->from_db,
- &from_table);
- if (ddl_log_increment_phase_no_lock(entry_pos))
- break;
- (void) ddl_log_sync_no_lock();
- }
+ /*
+ Stat tables must be updated last so that we can handle a rename of
+ a stat table. For now we just rememeber that we have to update it
+ */
+ update_flags(ddl_log_entry->entry_pos, DDL_LOG_FLAG_UPDATE_STAT);
+ ddl_log_entry->flags|= DDL_LOG_FLAG_UPDATE_STAT;
/* fall through */
case DDL_RENAME_PHASE_TABLE:
/* Restore frm and table to original names */
- to_length= build_table_filename(to_path, sizeof(to_path) - 1,
- ddl_log_entry->db.str,
- ddl_log_entry->name.str,
- reg_ext, 0);
- fr_length= build_table_filename(from_path, sizeof(from_path) - 1,
- ddl_log_entry->from_db.str,
- ddl_log_entry->from_name.str,
- reg_ext, 0);
- (void) mysql_file_rename(key_file_frm, to_path, from_path, MYF(MY_WME));
+ execute_rename_table(ddl_log_entry, file,
+ &ddl_log_entry->db, &ddl_log_entry->name,
+ &ddl_log_entry->from_db, &ddl_log_entry->from_name,
+ 0,
+ from_path, to_path);
- if (file->needs_lower_case_filenames())
- {
- build_lower_case_table_filename(to_path, sizeof(to_path) - 1,
- &ddl_log_entry->db,
- &to_table, 0);
- build_lower_case_table_filename(from_path, sizeof(from_path) - 1,
- &ddl_log_entry->from_db,
- &from_table, 0);
- }
- else
+ if (ddl_log_entry->flags & DDL_LOG_FLAG_UPDATE_STAT)
{
- /* remove extension from file name */
- DBUG_ASSERT(to_length != 0 && fr_length != 0);
- to_path[to_length - reg_ext_length]= 0;
- from_path[fr_length - reg_ext_length]= 0;
+ /* Update stat tables last */
+ rename_in_stat_tables(thd, ddl_log_entry, 0);
}
- file->ha_rename_table(to_path, from_path);
/* disable the entry and sync */
(void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE);
break;
@@ -1350,19 +1518,17 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
/* Not found or already deleted. Delete .frm if it exists */
strxnmov(to_path, sizeof(to_path)-1, path.str, reg_ext, NullS);
mysql_file_delete(key_file_frm, to_path, MYF(MY_WME|MY_IGNORE_ENOENT));
+ error= 0;
}
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
- (void) ddl_log_sync_no_lock();
/* Fall through */
case DDL_DROP_PHASE_TRIGGER:
Table_triggers_list::drop_all_triggers(thd, &db, &table,
MYF(MY_WME | MY_IGNORE_ENOENT));
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
- (void) ddl_log_sync_no_lock();
- /* Fall through */
-
+ /* fall through */
case DDL_DROP_PHASE_COLLECT:
if (strcmp(recovery_state.current_db, db.str))
{
@@ -1376,7 +1542,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
if (ddl_log_drop_to_binary_log(thd, ddl_log_entry,
&recovery_state.drop_table))
{
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
}
break;
@@ -1410,7 +1576,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
if (ddl_log_drop_to_binary_log(thd, ddl_log_entry,
&recovery_state.drop_view))
{
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
}
}
@@ -1504,9 +1670,9 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
mysql_file_delete_with_symlink(key_file_misc, to_path, "", MYF(0));
(void) rm_dir_w_symlink(path.str, 0);
- if (ddl_log_increment_phase_no_lock(entry_pos))
+ if (increment_phase(entry_pos))
break;
- /* Fall through */
+ /* fall through */
case DDL_DROP_DB_PHASE_LOG:
{
String *query= &recovery_state.drop_table;
@@ -1580,6 +1746,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
}
}
(void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE);
+ error= 0;
break;
}
case DDL_LOG_CREATE_VIEW_ACTION:
@@ -1735,6 +1902,320 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
}
break;
}
+ case DDL_LOG_ALTER_TABLE_ACTION:
+ {
+ handlerton *org_hton;
+ handler *org_file;
+ bool is_renamed= ddl_log_entry->flags & DDL_LOG_FLAG_ALTER_RENAME;
+ bool new_version_ready __attribute__((unused))= 0;
+ LEX_CSTRING db, table;
+ db= ddl_log_entry->db;
+ table= ddl_log_entry->name;
+
+ my_debug_put_break_here();
+ if (!(org_file= create_handler(thd, mem_root,
+ &ddl_log_entry->from_handler_name)))
+ goto end;
+ /* Handlerton of the final table and any temporary tables */
+ org_hton= org_file->ht;
+
+ switch (ddl_log_entry->phase) {
+ case DDL_ALTER_TABLE_PHASE_RENAME_FAILED:
+ /*
+ We come here when the final rename of temporary table (#sql-alter) to
+ the original name failed. Now we have to delete the temporary table
+ and restore the backup.
+ */
+ quick_rm_table(thd, hton, &db, &table, FN_IS_TMP);
+ if (!is_renamed)
+ {
+ execute_rename_table(ddl_log_entry, file,
+ &ddl_log_entry->from_db,
+ &ddl_log_entry->extra_name, // #sql-backup
+ &ddl_log_entry->from_db,
+ &ddl_log_entry->from_name,
+ FN_FROM_IS_TMP,
+ from_path, to_path);
+ }
+ (void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE);
+ break;
+ case DDL_ALTER_TABLE_PHASE_INPLACE_COPIED:
+ /* The inplace alter table is committed and ready to be used */
+ new_version_ready= 1;
+ /* fall through */
+ case DDL_ALTER_TABLE_PHASE_INPLACE:
+ {
+ int fr_length __attribute__((unused)) , to_length;
+ /*
+ Inplace alter table was used.
+ On disk there are now a table with the original name, the
+ original .frm file and potentially a #sql-alter...frm file
+ with the new definition.
+ */
+ fr_length= build_table_filename(from_path, sizeof(from_path) - 1,
+ ddl_log_entry->db.str,
+ ddl_log_entry->name.str,
+ reg_ext, 0);
+ to_length= build_table_filename(to_path, sizeof(to_path) - 1,
+ ddl_log_entry->from_db.str,
+ ddl_log_entry->from_name.str,
+ reg_ext, 0);
+ if (!access(from_path, F_OK)) // Does #sql-alter.. exists?
+ {
+ LEX_CUSTRING version= {ddl_log_entry->uuid, MY_UUID_SIZE};
+ /*
+ Temporary .frm file exists. This means that that the table in
+ the storage engine can be of either old or new version.
+ If old version, delete the new .frm table and keep the old one.
+ If new version, replace the old .frm with the new one.
+ */
+ to_path[to_length - reg_ext_length]= 0; // Remove .frm
+ if (!hton->check_version || new_version_ready ||
+ !hton->check_version(hton, to_path, &version,
+ ddl_log_entry->unique_id))
+ {
+ /* Table is up to date */
+
+ /*
+ Update state so that if we crash and retry the ddl log entry,
+ we know that we can use the new table even if .frm is renamed.
+ */
+ if (ddl_log_entry->phase != DDL_ALTER_TABLE_PHASE_INPLACE_COPIED)
+ (void) update_phase(entry_pos,
+ DDL_ALTER_TABLE_PHASE_INPLACE_COPIED);
+ /* Replace old .frm file with new one */
+ to_path[to_length - reg_ext_length]= FN_EXTCHAR;
+ (void) mysql_file_rename(key_file_frm, from_path, to_path,
+ MYF(MY_WME));
+ new_version_ready= 1;
+ }
+ else
+ {
+ DBUG_ASSERT(!new_version_ready);
+ /*
+ Use original version of the .frm file.
+ Remove temporary #sql-alter.frm file and the #sql-alter table.
+ We have also to remove the table as some storage engines,
+ like InnoDB, may use it as an internal temporary table
+ during inplace alter table.
+ */
+ error= org_hton->drop_table(org_hton, from_path);
+ if (non_existing_table_error(error))
+ error= 0;
+ mysql_file_delete(key_file_frm, from_path,
+ MYF(MY_WME|MY_IGNORE_ENOENT));
+ (void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE);
+ break;
+ }
+ }
+ if (is_renamed && new_version_ready)
+ {
+ /* After the renames above, the original table is now in from_name */
+ ddl_log_entry->name= ddl_log_entry->from_name;
+ /* Rename db.name -> db.extra_name */
+ execute_rename_table(ddl_log_entry, file,
+ &ddl_log_entry->db, &ddl_log_entry->name,
+ &ddl_log_entry->db, &ddl_log_entry->extra_name,
+ 0,
+ from_path, to_path);
+ }
+ (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_UPDATE_TRIGGERS);
+ goto update_triggers;
+ }
+ case DDL_ALTER_TABLE_PHASE_COPIED:
+ {
+ char *from_end;
+ /*
+ New table is created and we have the query for the binary log.
+ We should remove the original table and in the next stage replace
+ it with the new one.
+ */
+ build_table_filename(from_path, sizeof(from_path) - 1,
+ ddl_log_entry->from_db.str,
+ ddl_log_entry->from_name.str,
+ "", 0);
+ build_table_filename(to_path, sizeof(to_path) - 1,
+ ddl_log_entry->db.str,
+ ddl_log_entry->name.str,
+ "", 0);
+ from_end= strend(from_path);
+ if (likely(org_hton))
+ {
+ error= org_hton->drop_table(org_hton, from_path);
+ if (non_existing_table_error(error))
+ error= 0;
+ }
+ strmov(from_end, reg_ext);
+ mysql_file_delete(key_file_frm, from_path,
+ MYF(MY_WME|MY_IGNORE_ENOENT));
+ *from_end= 0; // Remove extension
+
+ (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_OLD_RENAMED);
+ }
+ /* fall through */
+ case DDL_ALTER_TABLE_PHASE_OLD_RENAMED:
+ {
+ /*
+ The new table (from_path) is up to date.
+ Original table is either renamed as backup table (normal case),
+ only frm is renamed (in case of engine change) or deleted above.
+ */
+ if (!is_renamed)
+ {
+ uint length;
+ /* Rename new "temporary" table to the original wanted name */
+ execute_rename_table(ddl_log_entry, file,
+ &ddl_log_entry->db,
+ &ddl_log_entry->name,
+ &ddl_log_entry->from_db,
+ &ddl_log_entry->from_name,
+ FN_FROM_IS_TMP,
+ from_path, to_path);
+
+ /*
+ Remove backup (only happens if alter table used without rename).
+ Backup name is always in lower case, so there is no need for
+ converting table names.
+ */
+ length= build_table_filename(from_path, sizeof(from_path) - 1,
+ ddl_log_entry->from_db.str,
+ ddl_log_entry->extra_name.str,
+ "", FN_IS_TMP);
+ if (likely(org_hton))
+ {
+ if (ddl_log_entry->flags & DDL_LOG_FLAG_ALTER_ENGINE_CHANGED)
+ {
+ /* Only frm is renamed, storage engine files have original name */
+ build_table_filename(to_path, sizeof(from_path) - 1,
+ ddl_log_entry->from_db.str,
+ ddl_log_entry->from_name.str,
+ "", 0);
+ error= org_hton->drop_table(org_hton, to_path);
+ }
+ else
+ error= org_hton->drop_table(org_hton, from_path);
+ if (non_existing_table_error(error))
+ error= 0;
+ }
+ strmov(from_path + length, reg_ext);
+ mysql_file_delete(key_file_frm, from_path,
+ MYF(MY_WME|MY_IGNORE_ENOENT));
+ }
+ else
+ execute_rename_table(ddl_log_entry, file,
+ &ddl_log_entry->db, &ddl_log_entry->name,
+ &ddl_log_entry->db, &ddl_log_entry->extra_name,
+ FN_FROM_IS_TMP,
+ from_path, to_path);
+ (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_UPDATE_TRIGGERS);
+ }
+ /* fall through */
+ case DDL_ALTER_TABLE_PHASE_UPDATE_TRIGGERS:
+ update_triggers:
+ {
+ if (is_renamed)
+ {
+ // rename_triggers will rename from: from_db.from_name -> db.extra_name
+ rename_triggers(thd, ddl_log_entry, 1);
+ (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_UPDATE_STATS);
+ }
+ }
+ /* fall through */
+ case DDL_ALTER_TABLE_PHASE_UPDATE_STATS:
+ if (is_renamed)
+ {
+ ddl_log_entry->name= ddl_log_entry->from_name;
+ ddl_log_entry->from_name= ddl_log_entry->extra_name;
+ rename_in_stat_tables(thd, ddl_log_entry, 1);
+ (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_UPDATE_STATS);
+ }
+ /* fall through */
+ case DDL_ALTER_TABLE_PHASE_UPDATE_BINARY_LOG:
+ {
+ /* Write ALTER TABLE query to binary log */
+ if (recovery_state.query.length() && mysql_bin_log.is_open())
+ {
+ /* Reuse old xid value if possible */
+ if (!recovery_state.xid)
+ recovery_state.xid= server_uuid_value();
+ thd->binlog_xid= recovery_state.xid;
+ update_xid(recovery_state.execute_entry_pos, thd->binlog_xid);
+
+ mysql_mutex_unlock(&LOCK_gdl);
+ (void) thd->binlog_query(THD::STMT_QUERY_TYPE,
+ recovery_state.query.ptr(),
+ recovery_state.query.length(),
+ TRUE, FALSE, FALSE, 0);
+ thd->binlog_xid= 0;
+ mysql_mutex_lock(&LOCK_gdl);
+ }
+ recovery_state.query.length(0);
+ (void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE);
+ break;
+ }
+ /*
+ The following cases are when alter table failed and we have to roll
+ back
+ */
+ case DDL_ALTER_TABLE_PHASE_CREATED:
+ {
+ /*
+ Temporary table should have been created. Delete it.
+ */
+ if (likely(hton))
+ {
+ error= hton->drop_table(hton, ddl_log_entry->tmp_name.str);
+ if (non_existing_table_error(error))
+ error= 0;
+ }
+ (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_INIT);
+ }
+ /* fall through */
+ case DDL_ALTER_TABLE_PHASE_INIT:
+ {
+ /*
+ A temporary .frm and possible a .par files should have been created
+ */
+ strxmov(to_path, ddl_log_entry->tmp_name.str, reg_ext, NullS);
+ mysql_file_delete(key_file_frm, to_path, MYF(MY_WME|MY_IGNORE_ENOENT));
+ strxmov(to_path, ddl_log_entry->tmp_name.str, PAR_EXT, NullS);
+ mysql_file_delete(key_file_partition_ddl_log, to_path,
+ MYF(MY_WME|MY_IGNORE_ENOENT));
+ (void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE);
+ break;
+ }
+ }
+ break;
+ }
+ case DDL_LOG_STORE_QUERY_ACTION:
+ {
+ /*
+ Read query for next ddl command
+ */
+ if (ddl_log_entry->flags)
+ {
+ /*
+ First QUERY event. Allocate query string.
+ Query length is stored in unique_id
+ */
+ if (recovery_state.query.alloc((size_t) (ddl_log_entry->unique_id+1)))
+ goto end;
+ recovery_state.query.length(0);
+ }
+ if (unlikely(recovery_state.query.length() +
+ ddl_log_entry->extra_name.length >
+ recovery_state.query.alloced_length()))
+ {
+ /* Impossible length. Ignore query */
+ recovery_state.query.length(0);
+ error= 1;
+ my_error(ER_INTERNAL_ERROR, MYF(0),
+ "DDL log: QUERY event has impossible length");
+ break;
+ }
+ recovery_state.query.qs_append(&ddl_log_entry->extra_name);
+ break;
+ }
default:
DBUG_ASSERT(0);
break;
@@ -1742,7 +2223,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
end:
delete file;
- if ((error= no_such_table_handler.unhandled_errors > 0))
+ if ((error= (no_such_table_handler.unhandled_errors > 0)))
my_errno= no_such_table_handler.first_error;
thd->pop_internal_handler();
DBUG_RETURN(error);
@@ -1821,6 +2302,8 @@ void ddl_log_release_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry)
global_ddl_log.first_used= next_log_entry;
if (next_log_entry)
next_log_entry->prev_log_entry= prev_log_entry;
+ // Ensure we get a crash if we try to access this link again.
+ log_entry->next_active_log_entry= (DDL_LOG_MEMORY_ENTRY*) 0x1;
DBUG_VOID_RETURN;
}
@@ -2060,6 +2543,8 @@ bool ddl_log_sync()
Executing an entry means executing a linked list of actions.
+ This function is called for recovering partitioning in case of error.
+
@param first_entry Reference to first action in entry
@return Operation status
@@ -2174,6 +2659,7 @@ int ddl_log_execute_recovery()
thd->log_all_errors= (global_system_variables.log_warnings >= 3);
recovery_state.drop_table.free();
recovery_state.drop_view.free();
+ recovery_state.query.free();
thd->set_query(recover_query_string, strlen(recover_query_string));
@@ -2187,6 +2673,13 @@ int ddl_log_execute_recovery()
}
if (ddl_log_entry.entry_type == DDL_LOG_EXECUTE_CODE)
{
+ /*
+ Remeber information about executive ddl log entry,
+ used for binary logging during recovery
+ */
+ recovery_state.execute_entry_pos= i;
+ recovery_state.xid= ddl_log_entry.xid;
+
/* purecov: begin tested */
if (ddl_log_entry.unique_id > DDL_LOG_MAX_RETRY)
{
@@ -2202,6 +2695,7 @@ int ddl_log_execute_recovery()
continue;
}
/* purecov: end tested */
+
if (ddl_log_execute_entry_no_lock(thd, ddl_log_entry.next_entry))
{
/* Real unpleasant scenario but we have to continue anyway */
@@ -2213,6 +2707,7 @@ int ddl_log_execute_recovery()
}
recovery_state.drop_table.free();
recovery_state.drop_view.free();
+ recovery_state.query.free();
close_ddl_log();
mysql_mutex_unlock(&LOCK_gdl);
thd->reset_query();
@@ -2280,7 +2775,7 @@ static void add_log_entry(DDL_LOG_STATE *state,
DDL_LOG_MEMORY_ENTRY *log_entry)
{
log_entry->next_active_log_entry= state->list;
- state->list= log_entry;
+ state->main_entry= state->list= log_entry;
}
@@ -2329,6 +2824,8 @@ void ddl_log_complete(DDL_LOG_STATE *state)
/**
Revert (execute) all entries in the ddl log
+
+ This is called for failed rename table, create trigger or drop trigger.
*/
void ddl_log_revert(THD *thd, DDL_LOG_STATE *state)
@@ -2352,13 +2849,48 @@ void ddl_log_revert(THD *thd, DDL_LOG_STATE *state)
/*
- Update phase of last created ddl log entry
+ Update phase of main ddl log entry (usually the last one created,
+ except in case of query events, the one before the query event).
*/
bool ddl_log_update_phase(DDL_LOG_STATE *state, uchar phase)
{
DBUG_ENTER("ddl_log_update_phase");
- DBUG_RETURN(update_phase(state->list->entry_pos, phase));
+ if (likely(state->list))
+ DBUG_RETURN(update_phase(state->main_entry->entry_pos, phase));
+ DBUG_RETURN(0);
+}
+
+
+/*
+ Update flag bits in main ddl log entry (usually last created, except in case
+ of query events, the one before the query event.
+*/
+
+bool ddl_log_add_flag(DDL_LOG_STATE *state, uint16 flags)
+{
+ DBUG_ENTER("ddl_log_update_phase");
+ if (likely(state->list))
+ {
+ state->flags|= flags;
+ DBUG_RETURN(update_flags(state->main_entry->entry_pos, state->flags));
+ }
+ DBUG_RETURN(0);
+}
+
+
+/**
+ Update unique_id (used for inplace alter table)
+*/
+
+bool ddl_log_update_unique_id(DDL_LOG_STATE *state, ulonglong id)
+{
+ DBUG_ENTER("ddl_log_update_unique_id");
+ DBUG_PRINT("enter", ("id: %llu", id));
+ /* The following may not be true in case of temporary tables */
+ if (likely(state->list))
+ DBUG_RETURN(update_unique_id(state->main_entry->entry_pos, id));
+ DBUG_RETURN(0);
}
@@ -2393,6 +2925,8 @@ bool ddl_log_update_xid(DDL_LOG_STATE *state, ulonglong xid)
/*
Write ddl_log_entry and write or update ddl_execute_entry
+
+ Will update DDL_LOG_STATE->flags
*/
static bool ddl_log_write(DDL_LOG_STATE *ddl_state,
@@ -2414,6 +2948,7 @@ static bool ddl_log_write(DDL_LOG_STATE *ddl_state,
DBUG_RETURN(1);
}
add_log_entry(ddl_state, log_entry);
+ ddl_state->flags|= ddl_log_entry->flags; // Update cache
DBUG_RETURN(0);
}
@@ -2675,7 +3210,7 @@ bool ddl_log_create_table(THD *thd, DDL_LOG_STATE *ddl_state,
ddl_log_entry.db= *const_cast<LEX_CSTRING*>(db);
ddl_log_entry.name= *const_cast<LEX_CSTRING*>(table);
ddl_log_entry.tmp_name= *const_cast<LEX_CSTRING*>(path);
- ddl_log_entry.flags= only_frm;
+ ddl_log_entry.flags= only_frm ? DDL_LOG_FLAG_ONLY_FRM : 0;
DBUG_RETURN(ddl_log_write(ddl_state, &ddl_log_entry));
}
@@ -2747,3 +3282,141 @@ bool ddl_log_create_trigger(THD *thd, DDL_LOG_STATE *ddl_state,
ddl_log_entry.phase= (uchar) phase;
DBUG_RETURN(ddl_log_write(ddl_state, &ddl_log_entry));
}
+
+
+/**
+ Log ALTER TABLE
+
+ $param backup_name Name of backup table. In case of ALTER TABLE rename
+ this is the final table name
+*/
+
+bool ddl_log_alter_table(THD *thd, DDL_LOG_STATE *ddl_state,
+ handlerton *org_hton,
+ const LEX_CSTRING *db, const LEX_CSTRING *table,
+ handlerton *new_hton,
+ const LEX_CSTRING *new_db,
+ const LEX_CSTRING *new_table,
+ const LEX_CSTRING *frm_path,
+ const LEX_CSTRING *backup_name,
+ const LEX_CUSTRING *version,
+ ulonglong table_version,
+ bool is_renamed)
+{
+ DDL_LOG_ENTRY ddl_log_entry;
+ DBUG_ENTER("ddl_log_alter_table");
+ DBUG_ASSERT(new_hton);
+ DBUG_ASSERT(org_hton);
+
+ bzero(&ddl_log_entry, sizeof(ddl_log_entry));
+ ddl_log_entry.action_type= DDL_LOG_ALTER_TABLE_ACTION;
+ if (new_hton)
+ lex_string_set(&ddl_log_entry.handler_name,
+ ha_resolve_storage_engine_name(new_hton));
+ /* Store temporary table name */
+ ddl_log_entry.db= *const_cast<LEX_CSTRING*>(new_db);
+ ddl_log_entry.name= *const_cast<LEX_CSTRING*>(new_table);
+ if (org_hton)
+ lex_string_set(&ddl_log_entry.from_handler_name,
+ ha_resolve_storage_engine_name(org_hton));
+ ddl_log_entry.from_db= *const_cast<LEX_CSTRING*>(db);
+ ddl_log_entry.from_name= *const_cast<LEX_CSTRING*>(table);
+ ddl_log_entry.tmp_name= *const_cast<LEX_CSTRING*>(frm_path);
+ ddl_log_entry.extra_name= *const_cast<LEX_CSTRING*>(backup_name);
+ ddl_log_entry.flags= is_renamed ? DDL_LOG_FLAG_ALTER_RENAME : 0;
+ ddl_log_entry.unique_id= table_version;
+
+ DBUG_ASSERT(version->length == MY_UUID_SIZE);
+ memcpy(ddl_log_entry.uuid, version->str, version->length);
+ DBUG_RETURN(ddl_log_write(ddl_state, &ddl_log_entry));
+}
+
+
+/*
+ Store query that later should be logged to binary log
+
+ The links of the query log event is
+
+ execute_log_event -> first log_query_event [-> log_query_event...] ->
+ action_log_event (probably a LOG_ALTER_TABLE_ACTION event)
+
+ This ensures that when we execute the log_query_event it can collect
+ the full query from the log_query_events and then execute the
+ action_log_event with the original query stored in 'recovery_state.query'.
+
+ The query is stored in ddl_log_entry.extra_name as this is the last string
+ stored in the log block (makes it easier to check and debug).
+*/
+
+bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_state,
+ const char *query, size_t length)
+{
+ DDL_LOG_ENTRY ddl_log_entry;
+ DDL_LOG_MEMORY_ENTRY *first_entry, *next_entry= 0;
+ DDL_LOG_MEMORY_ENTRY *original_entry= ddl_state->list;
+ size_t max_query_length;
+ uint entry_pos, next_entry_pos= 0, parent_entry_pos;
+ DBUG_ENTER("ddl_log_store_query");
+ DBUG_ASSERT(length <= UINT_MAX32);
+ DBUG_ASSERT(length > 0);
+ DBUG_ASSERT(ddl_state->list);
+
+ bzero(&ddl_log_entry, sizeof(ddl_log_entry));
+ ddl_log_entry.action_type= DDL_LOG_STORE_QUERY_ACTION;
+ ddl_log_entry.unique_id= length;
+ ddl_log_entry.flags= 1; // First entry
+
+ max_query_length= ddl_log_free_space_in_entry(&ddl_log_entry);
+
+ mysql_mutex_lock(&LOCK_gdl);
+ ddl_log_entry.entry_type= DDL_LOG_ENTRY_CODE;
+
+ if (ddl_log_get_free_entry(&first_entry))
+ goto err;
+ parent_entry_pos= ddl_state->list->entry_pos;
+ entry_pos= first_entry->entry_pos;
+ add_log_entry(ddl_state, first_entry);
+
+ while (length)
+ {
+ size_t write_length= MY_MIN(length, max_query_length);
+ ddl_log_entry.extra_name.str= query;
+ ddl_log_entry.extra_name.length= write_length;
+
+ query+= write_length;
+ length-= write_length;
+
+ if (length > 0)
+ {
+ if (ddl_log_get_free_entry(&next_entry))
+ goto err;
+ ddl_log_entry.next_entry= next_entry_pos= next_entry->entry_pos;
+ add_log_entry(ddl_state, next_entry);
+ }
+ else
+ {
+ /* point next link of last query_action event to the original action */
+ ddl_log_entry.next_entry= parent_entry_pos;
+ }
+ set_global_from_ddl_log_entry(&ddl_log_entry);
+ if (unlikely(write_ddl_log_file_entry(entry_pos)))
+ goto err;
+ entry_pos= next_entry_pos;
+ ddl_log_entry.flags= 0; // Only first entry has this set
+ }
+ if (ddl_log_write_execute_entry(first_entry->entry_pos,
+ &ddl_state->execute_entry))
+ goto err;
+
+ /* Set the original entry to be used for future PHASE updates */
+ ddl_state->main_entry= original_entry;
+ mysql_mutex_unlock(&LOCK_gdl);
+ DBUG_RETURN(0);
+err:
+ /*
+ Allocated ddl_log entries will be released by the
+ ddl_log_release_entries() call in dl_log_complete()
+ */
+ mysql_mutex_unlock(&LOCK_gdl);
+ DBUG_RETURN(1);
+}
diff --git a/sql/ddl_log.h b/sql/ddl_log.h
index 27cc0257c01..25a67354a5b 100644
--- a/sql/ddl_log.h
+++ b/sql/ddl_log.h
@@ -86,6 +86,8 @@ enum ddl_log_action_code
DDL_LOG_CREATE_VIEW_ACTION=13,
DDL_LOG_DELETE_TMP_FILE_ACTION=14,
DDL_LOG_CREATE_TRIGGER_ACTION=15,
+ DDL_LOG_ALTER_TABLE_ACTION=16,
+ DDL_LOG_STORE_QUERY_ACTION=17,
DDL_LOG_LAST_ACTION /* End marker */
};
@@ -142,6 +144,29 @@ enum enum_ddl_log_create_trigger_phase {
DDL_CREATE_TRIGGER_PHASE_END
};
+enum enum_ddl_log_alter_table_phase {
+ DDL_ALTER_TABLE_PHASE_INIT,
+ DDL_ALTER_TABLE_PHASE_RENAME_FAILED,
+ DDL_ALTER_TABLE_PHASE_INPLACE_COPIED,
+ DDL_ALTER_TABLE_PHASE_INPLACE,
+ DDL_ALTER_TABLE_PHASE_CREATED,
+ DDL_ALTER_TABLE_PHASE_COPIED,
+ DDL_ALTER_TABLE_PHASE_OLD_RENAMED,
+ DDL_ALTER_TABLE_PHASE_UPDATE_TRIGGERS,
+ DDL_ALTER_TABLE_PHASE_UPDATE_STATS,
+ DDL_ALTER_TABLE_PHASE_UPDATE_BINARY_LOG,
+ DDL_ALTER_TABLE_PHASE_END
+};
+
+
+/*
+ Flags stored in DDL_LOG_ENTRY.flags
+ The flag values can be reused for different commands
+*/
+#define DDL_LOG_FLAG_ALTER_RENAME (1 << 0)
+#define DDL_LOG_FLAG_ALTER_ENGINE_CHANGED (1 << 1)
+#define DDL_LOG_FLAG_ONLY_FRM (1 << 2)
+#define DDL_LOG_FLAG_UPDATE_STAT (1 << 3)
/*
Setting ddl_log_entry.phase to this has the same effect as setting
@@ -155,21 +180,22 @@ typedef struct st_ddl_log_entry
LEX_CSTRING name;
LEX_CSTRING from_name;
LEX_CSTRING handler_name;
- LEX_CSTRING tmp_name;
LEX_CSTRING db;
LEX_CSTRING from_db;
LEX_CSTRING from_handler_name;
+ LEX_CSTRING tmp_name; /* frm file or temporary file name */
+ LEX_CSTRING extra_name; /* Backup table name */
uchar uuid[MY_UUID_SIZE]; // UUID for new frm file
ulonglong xid; // Xid stored in the binary log
- uint next_entry;
- uint entry_pos; // Set by write_dll_log_entry()
/*
unique_id can be used to store a unique number to check current state.
- Currently it is used to store new size of frm file or link to a ddl log
- entry.
+ Currently it is used to store new size of frm file, link to another ddl log
+ entry or store an a uniq version for a storage engine in alter table.
*/
- uint32 unique_id; // Unique id for file version
+ ulonglong unique_id; // Unique id for file version
+ uint next_entry;
+ uint entry_pos; // Set by write_dll_log_entry()
uint16 flags; // Flags unique for each command
enum ddl_log_entry_code entry_type; // Set automatically
enum ddl_log_action_code action_type;
@@ -197,6 +223,12 @@ typedef struct st_ddl_log_state
DDL_LOG_MEMORY_ENTRY *list;
/* One execute entry per list */
DDL_LOG_MEMORY_ENTRY *execute_entry;
+ /*
+ Entry used for PHASE updates. Normally same as first in 'list', but in
+ case of a query log event, this points to the main event.
+ */
+ DDL_LOG_MEMORY_ENTRY *main_entry;
+ uint16 flags; /* Cache for flags */
bool is_active() { return list != 0; }
} DDL_LOG_STATE;
@@ -219,6 +251,8 @@ void ddl_log_complete(DDL_LOG_STATE *ddl_log_state);
void ddl_log_revert(THD *thd, DDL_LOG_STATE *ddl_log_state);
bool ddl_log_update_phase(DDL_LOG_STATE *entry, uchar phase);
+bool ddl_log_add_flag(DDL_LOG_STATE *entry, uint16 flag);
+bool ddl_log_update_unique_id(DDL_LOG_STATE *state, ulonglong id);
bool ddl_log_update_xid(DDL_LOG_STATE *state, ulonglong xid);
bool ddl_log_disable_entry(DDL_LOG_STATE *state);
bool ddl_log_increment_phase(uint entry_pos);
@@ -281,5 +315,18 @@ bool ddl_log_create_trigger(THD *thd, DDL_LOG_STATE *ddl_state,
const LEX_CSTRING *db, const LEX_CSTRING *table,
const LEX_CSTRING *trigger_name,
enum_ddl_log_create_trigger_phase phase);
+bool ddl_log_alter_table(THD *thd, DDL_LOG_STATE *ddl_state,
+ handlerton *org_hton,
+ const LEX_CSTRING *db, const LEX_CSTRING *table,
+ handlerton *new_hton,
+ const LEX_CSTRING *new_db,
+ const LEX_CSTRING *new_table,
+ const LEX_CSTRING *frm_path,
+ const LEX_CSTRING *backup_table_name,
+ const LEX_CUSTRING *version,
+ ulonglong table_version,
+ bool is_renamed);
+bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_log_state,
+ const char *query, size_t length);
extern mysql_mutex_t LOCK_gdl;
#endif /* DDL_LOG_INCLUDED */
diff --git a/sql/handler.h b/sql/handler.h
index ba3d9c2ab45..91a437aee85 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1543,6 +1543,33 @@ struct handlerton
THD *victim_thd, my_bool signal);
int (*set_checkpoint)(handlerton *hton, const XID* xid);
int (*get_checkpoint)(handlerton *hton, XID* xid);
+ /**
+ Check if the version of the table matches the version in the .frm
+ file.
+
+ This is mainly used to verify in recovery to check if an inplace
+ ALTER TABLE succeded.
+ Storage engines that does not support inplace alter table does not
+ have to implement this function.
+
+ @param hton handlerton
+ @param path Path for table
+ @param version The unique id that is stored in the .frm file for
+ CREATE and updated for each ALTER TABLE (but not for
+ simple renames).
+ This is the ID used for the final table.
+ @param create_id The value returned from handler->table_version() for
+ the original table (before ALTER TABLE).
+
+ @retval 0 If id matches or table is newer than create_id (depending
+ on what version check the engine supports. This means that
+ The (inplace) alter table did succeed.
+ @retval # > 0 Alter table did not succeed.
+
+ Related to handler::discover_check_version().
+ */
+ int (*check_version)(handlerton *hton, const char *path,
+ const LEX_CUSTRING *version, ulonglong create_id);
/*
Optional clauses in the CREATE/ALTER TABLE
*/
@@ -4030,6 +4057,15 @@ public:
{ return 0; }
virtual int extra_opt(enum ha_extra_function operation, ulong arg)
{ return extra(operation); }
+ /*
+ Table version id for the the table. This should change for each
+ sucessfull ALTER TABLE.
+ This is used by the handlerton->check_version() to ask the engine
+ if the table definition has been updated.
+ Storage engines that does not support inplace alter table does not
+ have to support this call.
+ */
+ virtual ulonglong table_version() const { return 0; }
/**
In an UPDATE or DELETE, if the row under the cursor was locked by another
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 1165b87356a..2922b8d215a 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -6833,14 +6833,18 @@ void uuid_short_init()
(((ulonglong) server_start_time) << 24));
}
-
-longlong Item_func_uuid_short::val_int()
+ulonglong server_uuid_value()
{
ulonglong val;
mysql_mutex_lock(&LOCK_short_uuid_generator);
val= uuid_value++;
mysql_mutex_unlock(&LOCK_short_uuid_generator);
- return (longlong) val;
+ return val;
+}
+
+longlong Item_func_uuid_short::val_int()
+{
+ return (longlong) server_uuid_value();
}
diff --git a/sql/item_func.h b/sql/item_func.h
index c237fcd9ecc..04d397c99c6 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -4048,6 +4048,7 @@ public:
void uuid_short_init();
+ulonglong server_uuid_value();
class Item_func_uuid_short :public Item_longlong_func
{
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index b8f98594851..6c1dbdf20df 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7979,3 +7979,5 @@ ER_ORACLE_COMPAT_FUNCTION_ERROR
eng "Oracle compatibility function error: %s"
ER_REMOVED_ORPHAN_TRIGGER
eng "Dropped orphan trigger '%-.64s', originally created for table: '%-.192s'"
+ER_STORAGE_ENGINE_DISABLED
+ eng "Storage engine %s is disabled"
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 20a6df554e4..07634fcd45a 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -6166,8 +6166,9 @@ static void release_part_info_log_entries(DDL_LOG_MEMORY_ENTRY *log_entry)
while (log_entry)
{
+ DDL_LOG_MEMORY_ENTRY *next= log_entry->next_active_log_entry;
ddl_log_release_memory_entry(log_entry);
- log_entry= log_entry->next_active_log_entry;
+ log_entry= next;
}
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 544de7e372d..c545978f4e6 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4884,7 +4884,7 @@ mysql_rename_table(handlerton *base, const LEX_CSTRING *old_db,
DBUG_RETURN(TRUE);
}
- if (file->needs_lower_case_filenames())
+ if (file && file->needs_lower_case_filenames())
{
build_lower_case_table_filename(lc_from, sizeof(lc_from) -1,
old_db, old_name, flags & FN_FROM_IS_TMP);
@@ -7033,6 +7033,7 @@ static bool mysql_inplace_alter_table(THD *thd,
TABLE *altered_table,
Alter_inplace_info *ha_alter_info,
MDL_request *target_mdl_request,
+ DDL_LOG_STATE *ddl_log_state,
TRIGGER_RENAME_PARAM *trigger_param,
Alter_table_ctx *alter_ctx)
{
@@ -7158,6 +7159,19 @@ static bool mysql_inplace_alter_table(THD *thd,
goto rollback;
/*
+ Store the new table_version() as it may have not been available before
+ in some engines, like InnoDB.
+ */
+ ddl_log_update_unique_id(ddl_log_state,
+ table->file->table_version());
+ /*
+ Mark that we have started inplace alter table. DDL recover will
+ have to decide if it should use the old or new version of the table, based
+ on if the new version did commit or not.
+ */
+ ddl_log_update_phase(ddl_log_state, DDL_ALTER_TABLE_PHASE_INPLACE);
+
+ /*
Downgrade the lock if storage engine has told us that exclusive lock was
necessary only for prepare phase (unless we are not under LOCK TABLES) and
user has not explicitly requested exclusive lock.
@@ -7202,6 +7216,8 @@ static bool mysql_inplace_alter_table(THD *thd,
if (backup_reset_alter_copy_lock(thd))
goto rollback;
+ /* Crashing here should cause the original table to be used */
+ debug_crash_here("ddl_log_alter_after_copy");
/*
If we are killed after this point, we should ignore and continue.
We have mostly completed the operation at this point, there should
@@ -7219,6 +7235,33 @@ static bool mysql_inplace_alter_table(THD *thd,
DEBUG_SYNC(thd, "alter_table_inplace_before_commit");
THD_STAGE_INFO(thd, stage_alter_inplace_commit);
+ /*
+ Notify the engine that the table definition has changed so that it can
+ store the new ID as part of the commit
+ */
+
+ if (table->file->partition_ht()->notify_tabledef_changed)
+ {
+ char db_buff[FN_REFLEN], table_buff[FN_REFLEN];
+ handlerton *hton= table->file->ht;
+ LEX_CSTRING tmp_db, tmp_table;
+
+ tmp_db.str= db_buff;
+ tmp_table.str= table_buff;
+ tmp_db.length= tablename_to_filename(table_list->db.str,
+ db_buff, sizeof(db_buff));
+ tmp_table.length= tablename_to_filename(table_list->table_name.str,
+ table_buff, sizeof(table_buff));
+ if ((hton->notify_tabledef_changed)(hton, &tmp_db, &tmp_table,
+ table->s->frm_image,
+ &table->s->tabledef_version,
+ table->file))
+ {
+ my_error(HA_ERR_INCOMPATIBLE_DEFINITION, MYF(0));
+ DBUG_RETURN(true);
+ }
+ }
+
{
TR_table trt(thd, true);
if (trt != *table_list && table->file->ht->prepare_commit_versioned)
@@ -7243,29 +7286,14 @@ static bool mysql_inplace_alter_table(THD *thd,
goto rollback;
}
- /* Notify the engine that the table definition has changed */
-
- if (table->file->partition_ht()->notify_tabledef_changed)
- {
- char db_buff[FN_REFLEN], table_buff[FN_REFLEN];
- handlerton *hton= table->file->ht;
- LEX_CSTRING tmp_db, tmp_table;
-
- tmp_db.str= db_buff;
- tmp_table.str= table_buff;
- tmp_db.length= tablename_to_filename(table_list->db.str,
- db_buff, sizeof(db_buff));
- tmp_table.length= tablename_to_filename(table_list->table_name.str,
- table_buff, sizeof(table_buff));
- if ((hton->notify_tabledef_changed)(hton, &tmp_db, &tmp_table,
- table->s->frm_image,
- &table->s->tabledef_version,
- table->file))
- {
- my_error(HA_ERR_INCOMPATIBLE_DEFINITION, MYF(0));
- DBUG_RETURN(true);
- }
- }
+ /*
+ We are new ready to use the new table. Update the state in the
+ ddl log so that we recovery know that the new table is ready and
+ in case of crash it should use the new one and log the query
+ to the binary log.
+ */
+ ddl_log_update_phase(ddl_log_state, DDL_ALTER_TABLE_PHASE_INPLACE_COPIED);
+ debug_crash_here("ddl_log_alter_after_log");
close_all_tables_for_name(thd, table->s,
alter_ctx->is_table_renamed() ?
@@ -7277,7 +7305,8 @@ static bool mysql_inplace_alter_table(THD *thd,
/*
Replace the old .FRM with the new .FRM, but keep the old name for now.
Rename to the new name (if needed) will be handled separately below.
-
+ */
+ /*
TODO: remove this check of thd->is_error() (now it intercept
errors in some val_*() methods and bring some single place to
such error interception).
@@ -7290,6 +7319,7 @@ static bool mysql_inplace_alter_table(THD *thd,
// Since changes were done in-place, we can't revert them.
DBUG_RETURN(true);
}
+ debug_crash_here("ddl_log_alter_after_rename_frm");
// Rename altered table in case of ALTER TABLE ... RENAME
if (alter_ctx->is_table_renamed())
@@ -7305,6 +7335,7 @@ static bool mysql_inplace_alter_table(THD *thd,
*/
DBUG_RETURN(true);
}
+ debug_crash_here("ddl_log_alter_before_rename_triggers");
if (Table_triggers_list::change_table_name(thd, trigger_param,
&alter_ctx->db,
&alter_ctx->alias,
@@ -7320,10 +7351,12 @@ static bool mysql_inplace_alter_table(THD *thd,
&alter_ctx->new_db, &alter_ctx->new_alias,
&alter_ctx->db, &alter_ctx->alias,
NO_FK_CHECKS);
+ ddl_log_disable_entry(ddl_log_state);
DBUG_RETURN(true);
}
rename_table_in_stat_tables(thd, &alter_ctx->db, &alter_ctx->alias,
&alter_ctx->new_db, &alter_ctx->new_alias);
+ debug_crash_here("ddl_log_alter_after_rename_triggers");
}
DBUG_RETURN(false);
@@ -8809,6 +8842,13 @@ simple_tmp_rename_or_index_change(THD *thd, TABLE_LIST *table_list,
@return Operation status
@retval false Success
@retval true Failure
+
+ @notes
+ Normally with ALTER TABLE we roll forward as soon as data is copied
+ or new table is committed. For an ALTER TABLE that only does a RENAME,
+ we will roll back unless the RENAME fully completes.
+ If we crash while using enable/disable keys, this may have completed
+ and will not be rolled back.
*/
static bool
@@ -8819,11 +8859,13 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list,
{
TABLE *table= table_list->table;
MDL_ticket *mdl_ticket= table->mdl_ticket;
+ DDL_LOG_STATE ddl_log_state;
int error= 0;
enum ha_extra_function extra_func= thd->locked_tables_mode
? HA_EXTRA_NOT_USED
: HA_EXTRA_FORCE_REOPEN;
DBUG_ENTER("simple_rename_or_index_change");
+ bzero(&ddl_log_state, sizeof(ddl_log_state));
if (keys_onoff != Alter_info::LEAVE_AS_IS)
{
@@ -8858,37 +8900,52 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list,
close_all_tables_for_name(thd, table->s, HA_EXTRA_PREPARE_FOR_RENAME,
NULL);
+ (void) ddl_log_rename_table(thd, &ddl_log_state, old_db_type,
+ &alter_ctx->db, &alter_ctx->table_name,
+ &alter_ctx->new_db, &alter_ctx->new_alias);
if (mysql_rename_table(old_db_type, &alter_ctx->db, &alter_ctx->table_name,
&alter_ctx->new_db, &alter_ctx->new_alias, 0))
error= -1;
- else if (Table_triggers_list::change_table_name(thd, trigger_param,
- &alter_ctx->db,
- &alter_ctx->alias,
- &alter_ctx->table_name,
- &alter_ctx->new_db,
- &alter_ctx->new_alias))
+ if (!error)
+ ddl_log_update_phase(&ddl_log_state, DDL_RENAME_PHASE_TRIGGER);
+ debug_crash_here("ddl_log_alter_before_rename_triggers");
+ if (!error &&
+ Table_triggers_list::change_table_name(thd, trigger_param,
+ &alter_ctx->db,
+ &alter_ctx->alias,
+ &alter_ctx->table_name,
+ &alter_ctx->new_db,
+ &alter_ctx->new_alias))
{
(void) mysql_rename_table(old_db_type,
&alter_ctx->new_db, &alter_ctx->new_alias,
&alter_ctx->db, &alter_ctx->table_name,
NO_FK_CHECKS);
+ ddl_log_disable_entry(&ddl_log_state);
error= -1;
}
- /* Update stat tables last. This is to be able to handle rename of a stat table */
+ /*
+ Update stat tables last. This is to be able to handle rename of
+ a stat table.
+ */
if (error == 0)
(void) rename_table_in_stat_tables(thd, &alter_ctx->db,
&alter_ctx->table_name,
&alter_ctx->new_db,
&alter_ctx->new_alias);
+ debug_crash_here("ddl_log_alter_after_rename_triggers");
}
if (likely(!error))
{
+ thd->binlog_xid= thd->query_id;
+ ddl_log_update_xid(&ddl_log_state, thd->binlog_xid);
error= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
-
+ thd->binlog_xid= 0;
if (likely(!error))
my_ok(thd);
}
+ ddl_log_complete(&ddl_log_state);
table_list->table= NULL; // For query cache
query_cache_invalidate3(thd, table_list, 0);
@@ -9017,6 +9074,8 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
bool engine_changed, error;
bool no_ha_table= true; /* We have not created table in storage engine yet */
TABLE *table, *new_table;
+ DDL_LOG_STATE ddl_log_state;
+
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool partition_changed= false;
bool fast_alter_partition= false;
@@ -9042,7 +9101,9 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
handlerton *new_db_type, *old_db_type;
ha_rows copied=0, deleted=0;
LEX_CUSTRING frm= {0,0};
- char index_file[FN_REFLEN], data_file[FN_REFLEN];
+ LEX_CSTRING backup_name;
+ char index_file[FN_REFLEN], data_file[FN_REFLEN], backup_name_buff[60];
+ uchar uuid_buffer[MY_UUID_SIZE];
MDL_request target_mdl_request;
MDL_ticket *mdl_ticket= 0;
Alter_table_prelocking_strategy alter_prelocking_strategy;
@@ -9091,6 +9152,13 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
}
THD_STAGE_INFO(thd, stage_init_update);
+ bzero(&ddl_log_state, sizeof(ddl_log_state));
+
+ /* Temporary name for backup of original table */
+ backup_name.str= backup_name_buff;
+ backup_name.length= my_snprintf(backup_name_buff, sizeof(backup_name_buff)-1,
+ "%s-backup-%lx-%llx", tmp_file_prefix,
+ current_pid, thd->thread_id);
/* Check if the new table type is a shared table */
if (ha_check_if_updates_are_ignored(thd, create_info->db_type, "ALTER"))
@@ -9703,9 +9771,45 @@ do_continue:;
DEBUG_SYNC(thd, "alter_table_before_create_table_no_lock");
+ /* Create a new table version id for the new table */
+ my_uuid(uuid_buffer);
+ create_info->tabledef_version.str= uuid_buffer;
+ create_info->tabledef_version.length= MY_UUID_SIZE;
+
+ if (!table->s->tmp_table)
+ {
+ LEX_CSTRING path_to_frm= alter_ctx.get_tmp_cstring_path();
+ LEX_CSTRING tmp_table= backup_name;
+ if (alter_ctx.is_table_renamed())
+ tmp_table= alter_ctx.new_alias;
+
+ if (ddl_log_alter_table(thd, &ddl_log_state,
+ old_db_type,
+ &alter_ctx.db, &alter_ctx.table_name,
+ new_db_type, &alter_ctx.new_db, &alter_ctx.tmp_name,
+ &path_to_frm,
+ &tmp_table,
+ &create_info->tabledef_version,
+ table->file->table_version(),
+ alter_ctx.is_table_renamed()) ||
+ ddl_log_store_query(thd, &ddl_log_state,
+ thd->query(), thd->query_length()))
+ {
+ error= 1;
+ goto err_cleanup;
+ }
+ }
+
tmp_disable_binlog(thd);
create_info->options|=HA_CREATE_TMP_ALTER;
create_info->alias= alter_ctx.table_name;
+ /*
+ Create the .frm file for the new table. Storage engine table will not be
+ created at this stage.
+
+ No ddl logging needed as ddl_log_alter_query will take care of failed
+ table creations.
+ */
error= create_table_impl(thd, (DDL_LOG_STATE*) 0, (DDL_LOG_STATE*) 0,
alter_ctx.db, alter_ctx.table_name,
alter_ctx.new_db, alter_ctx.tmp_name,
@@ -9714,11 +9818,11 @@ do_continue:;
C_ALTER_TABLE_FRM_ONLY, NULL,
&key_info, &key_count, &frm);
reenable_binlog(thd);
+
+ debug_crash_here("ddl_log_alter_after_create_frm");
+
if (unlikely(error))
- {
- my_free(const_cast<uchar*>(frm.str));
- DBUG_RETURN(true);
- }
+ goto err_cleanup;
if (alter_info->algorithm(thd) != Alter_info::ALTER_TABLE_ALGORITHM_COPY)
{
@@ -9760,7 +9864,6 @@ do_continue:;
*/
table->file->ha_create_partitioning_metadata(alter_ctx.get_tmp_path(),
NULL, CHF_DELETE_FLAG);
- my_free(const_cast<uchar*>(frm.str));
goto end_inplace;
}
@@ -9845,19 +9948,17 @@ do_continue:;
*/
enum_check_fields org_count_cuted_fields= thd->count_cuted_fields;
thd->count_cuted_fields= CHECK_FIELD_WARN;
- int res= mysql_inplace_alter_table(thd,
- table_list, table, &altered_table,
+ int res= mysql_inplace_alter_table(thd, table_list, table, &altered_table,
&ha_alter_info,
- &target_mdl_request,
+ &target_mdl_request, &ddl_log_state,
&trigger_param,
&alter_ctx);
thd->count_cuted_fields= org_count_cuted_fields;
- my_free(const_cast<uchar*>(frm.str));
if (res)
{
cleanup_table_after_inplace_alter(&altered_table);
- DBUG_RETURN(true);
+ goto err_cleanup;
}
cleanup_table_after_inplace_alter_keep_files(&altered_table);
@@ -9909,11 +10010,15 @@ do_continue:;
MYSQL_LOCK_USE_MALLOC))
goto err_new_table_cleanup;
+ ddl_log_update_phase(&ddl_log_state, DDL_ALTER_TABLE_PHASE_CREATED);
+
if (ha_create_table(thd, alter_ctx.get_tmp_path(),
alter_ctx.new_db.str, alter_ctx.new_name.str,
create_info, &frm))
goto err_new_table_cleanup;
+ debug_crash_here("ddl_log_alter_after_create_table");
+
/* Mark that we have created table in storage engine. */
no_ha_table= false;
DEBUG_SYNC(thd, "alter_table_intermediate_table_created");
@@ -10058,10 +10163,16 @@ do_continue:;
/* We don't replicate alter table statement on temporary tables */
if (!thd->is_current_stmt_binlog_format_row() &&
table_creation_was_logged &&
- !binlog_as_create_select &&
- write_bin_log_with_if_exists(thd, true, false, log_if_exists))
- DBUG_RETURN(true);
- my_free(const_cast<uchar*>(frm.str));
+ !binlog_as_create_select)
+ {
+ int tmp_error;
+ thd->binlog_xid= thd->query_id;
+ ddl_log_update_xid(&ddl_log_state, thd->binlog_xid);
+ tmp_error= write_bin_log_with_if_exists(thd, true, false, log_if_exists);
+ thd->binlog_xid= 0;
+ if (tmp_error)
+ goto err_cleanup;
+ }
goto end_temporary;
}
@@ -10108,6 +10219,18 @@ do_continue:;
(mysql_execute_command()) to release metadata locks.
*/
+ debug_crash_here("ddl_log_alter_after_copy"); // Use old table
+ /*
+ We are new ready to use the new table. Update the state in the
+ ddl log so that we recovery know that the new table is ready and
+ in case of crash it should use the new one and log the query
+ to the binary log.
+ */
+ if (engine_changed)
+ ddl_log_add_flag(&ddl_log_state, DDL_LOG_FLAG_ALTER_ENGINE_CHANGED);
+ ddl_log_update_phase(&ddl_log_state, DDL_ALTER_TABLE_PHASE_COPIED);
+ debug_crash_here("ddl_log_alter_after_log"); // Use new table
+
THD_STAGE_INFO(thd, stage_rename_result_table);
if (wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME))
@@ -10119,29 +10242,20 @@ do_continue:;
HA_EXTRA_NOT_USED,
NULL);
table_list->table= table= NULL; /* Safety */
- my_free(const_cast<uchar*>(frm.str));
-
- /*
- Rename the old table to temporary name to have a backup in case
- anything goes wrong while renaming the new table.
- We only have to do this if name of the table is not changed.
- If we are changing to use another table handler, we don't
- have to do the rename as the table names will not interfer.
- */
- char backup_name_buff[FN_LEN];
- LEX_CSTRING backup_name;
- backup_name.str= backup_name_buff;
DBUG_PRINT("info", ("is_table_renamed: %d engine_changed: %d",
alter_ctx.is_table_renamed(), engine_changed));
if (!alter_ctx.is_table_renamed())
{
- backup_name.length= my_snprintf(backup_name_buff, sizeof(backup_name_buff),
- "%s-backup-%lx-%llx", tmp_file_prefix,
- current_pid, thd->thread_id);
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, backup_name_buff);
+ /*
+ Rename the old table to temporary name to have a backup in case
+ anything goes wrong while renaming the new table.
+
+ We only have to do this if name of the table is not changed.
+ If we are changing to use another table handler, we don't
+ have to do the rename as the table names will not interfer.
+ */
if (mysql_rename_table(old_db_type, &alter_ctx.db, &alter_ctx.table_name,
&alter_ctx.db, &backup_name,
FN_TO_IS_TMP |
@@ -10160,6 +10274,18 @@ do_continue:;
PSI_CALL_drop_table_share(0, alter_ctx.db.str, (int) alter_ctx.db.length,
alter_ctx.table_name.str, (int) alter_ctx.table_name.length);
}
+ debug_crash_here("ddl_log_alter_after_rename_to_backup");
+
+ if (!alter_ctx.is_table_renamed())
+ {
+ /*
+ We should not set this stage in case of rename as we in this case
+ must execute DDL_ALTER_TABLE_PHASE_COPIED to remove the orignal table
+ */
+ ddl_log_update_phase(&ddl_log_state, DDL_ALTER_TABLE_PHASE_OLD_RENAMED);
+ }
+
+ debug_crash_here("ddl_log_alter_after_rename_to_backup_log");
// Rename the new table to the correct name.
if (mysql_rename_table(new_db_type, &alter_ctx.new_db, &alter_ctx.tmp_name,
@@ -10167,6 +10293,7 @@ do_continue:;
FN_FROM_IS_TMP))
{
// Rename failed, delete the temporary table.
+ ddl_log_update_phase(&ddl_log_state, DDL_ALTER_TABLE_PHASE_RENAME_FAILED);
(void) quick_rm_table(thd, new_db_type, &alter_ctx.new_db,
&alter_ctx.tmp_name, FN_IS_TMP);
@@ -10181,10 +10308,12 @@ do_continue:;
}
goto err_with_mdl;
}
+ debug_crash_here("ddl_log_alter_after_rename_to_original");
// Check if we renamed the table and if so update trigger files.
if (alter_ctx.is_table_renamed())
{
+ debug_crash_here("ddl_log_alter_before_rename_triggers");
if (Table_triggers_list::change_table_name(thd, &trigger_param,
&alter_ctx.db,
&alter_ctx.alias,
@@ -10205,12 +10334,15 @@ do_continue:;
}
rename_table_in_stat_tables(thd, &alter_ctx.db, &alter_ctx.alias,
&alter_ctx.new_db, &alter_ctx.new_alias);
+ debug_crash_here("ddl_log_alter_after_rename_triggers");
}
// ALTER TABLE succeeded, delete the backup of the old table.
error= quick_rm_table(thd, old_db_type, &alter_ctx.db, &backup_name,
FN_IS_TMP |
(engine_changed ? NO_HA_TABLE | NO_PAR_TABLE: 0));
+
+ debug_crash_here("ddl_log_alter_after_delete_backup");
if (engine_changed)
{
/* the .frm file was removed but not the original table */
@@ -10219,6 +10351,7 @@ do_continue:;
NO_FRM_RENAME |
(engine_changed ? 0 : FN_IS_TMP));
}
+ debug_crash_here("ddl_log_alter_after_drop_original_table");
if (binlog_as_create_select)
{
/*
@@ -10254,8 +10387,13 @@ end_inplace:
(create_info->tmp_table())));
if (!binlog_as_create_select)
{
- if (write_bin_log_with_if_exists(thd, true, false, log_if_exists))
- DBUG_RETURN(true);
+ int tmp_error;
+ thd->binlog_xid= thd->query_id;
+ ddl_log_update_xid(&ddl_log_state, thd->binlog_xid);
+ tmp_error= write_bin_log_with_if_exists(thd, true, false, log_if_exists);
+ thd->binlog_xid= 0;
+ if (tmp_error)
+ goto err_cleanup;
}
table_list->table= NULL; // For query cache
query_cache_invalidate3(thd, table_list, false);
@@ -10270,6 +10408,9 @@ end_inplace:
}
end_temporary:
+ my_free(const_cast<uchar*>(frm.str));
+ ddl_log_complete(&ddl_log_state);
+
thd->variables.option_bits&= ~OPTION_BIN_COMMIT_OFF;
my_snprintf(alter_ctx.tmp_buff, sizeof(alter_ctx.tmp_buff),
@@ -10284,7 +10425,6 @@ err_new_table_cleanup:
DBUG_PRINT("error", ("err_new_table_cleanup"));
thd->variables.option_bits&= ~OPTION_BIN_COMMIT_OFF;
- my_free(const_cast<uchar*>(frm.str));
/*
No default value was provided for a DATE/DATETIME field, the
current sql_mode doesn't allow the '0000-00-00' value and
@@ -10309,6 +10449,9 @@ err_new_table_cleanup:
(FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)),
alter_ctx.get_tmp_path());
+err_cleanup:
+ my_free(const_cast<uchar*>(frm.str));
+ ddl_log_complete(&ddl_log_state);
DBUG_RETURN(true);
err_with_mdl_after_alter:
@@ -10325,6 +10468,7 @@ err_with_mdl_after_alter:
write_bin_log_with_if_exists(thd, FALSE, FALSE, log_if_exists);
err_with_mdl:
+ ddl_log_complete(&ddl_log_state);
/*
An error happened while we were holding exclusive name metadata lock
on table being altered. To be safe under LOCK TABLES we should
@@ -10334,7 +10478,7 @@ err_with_mdl:
thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0);
if (!table_list->table)
thd->mdl_context.release_all_locks_for_name(mdl_ticket);
- DBUG_RETURN(true);
+ goto err_cleanup;
}
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc
index 9d5daef6332..2fd8b8cefc3 100644
--- a/storage/innobase/dict/dict0crea.cc
+++ b/storage/innobase/dict/dict0crea.cc
@@ -520,11 +520,11 @@ dict_create_sys_indexes_tuple(
entry, DICT_COL__SYS_INDEXES__NAME);
if (!index->is_committed()) {
- ulint len = strlen(index->name) + 1;
+ ulint len = strlen(index->name) + 2;
char* name = static_cast<char*>(
mem_heap_alloc(heap, len));
- *name = *TEMP_INDEX_PREFIX_STR;
- memcpy(name + 1, index->name, len - 1);
+ memset(name, *TEMP_INDEX_PREFIX_STR, 2);
+ memcpy(name + 2, index->name, len - 2);
dfield_set_data(dfield, name, len);
} else {
dfield_set_data(dfield, index->name, strlen(index->name));
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index fea22112178..b178f2dc77a 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1183,11 +1183,14 @@ err_len:
pos = mach_read_from_4(field);
- rec_get_nth_field_offs_old(
+ field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_COLUMNS__DB_TRX_ID, &len);
if (len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL) {
goto err_len;
}
+
+ const trx_id_t trx_id = mach_read_from_6(field);
+
rec_get_nth_field_offs_old(
rec, DICT_FLD__SYS_COLUMNS__DB_ROLL_PTR, &len);
if (len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL) {
@@ -1274,6 +1277,10 @@ err_len:
dict_mem_table_add_col(table, heap, name, mtype,
prtype, col_len);
}
+
+ if (trx_id > table->def_trx_id) {
+ table->def_trx_id = trx_id;
+ }
} else {
dict_mem_fill_column_struct(column, pos, mtype,
prtype, col_len);
@@ -2072,10 +2079,40 @@ dict_load_indexes(
}
break;
- } else if (err_msg == dict_load_index_del) {
- /* Skip delete-marked records. */
- goto next_rec;
- } else if (err_msg) {
+ }
+
+ ulint len;
+
+ if (!err_msg) {
+load_index_trx_id:
+ trx_id_t id = mach_read_from_6(
+ rec_get_nth_field_old(
+ rec, DICT_FLD__SYS_INDEXES__DB_TRX_ID,
+ &len));
+ ut_ad(len == DATA_TRX_ID_LEN);
+ if (id > table->def_trx_id) {
+ table->def_trx_id = id;
+ }
+ if (err_msg) {
+ /* Skip delete-marked records. */
+ goto next_rec;
+ }
+ } else {
+ if (err_msg == dict_load_index_del) {
+ const char* n = reinterpret_cast<const char*>
+ (rec_get_nth_field_old(
+ rec,
+ DICT_FLD__SYS_INDEXES__NAME,
+ &len));
+ if (len != UNIV_SQL_NULL && len >= 2
+ && (n[0] != *TEMP_INDEX_PREFIX_STR
+ || n[1] != *TEMP_INDEX_PREFIX_STR)) {
+ goto load_index_trx_id;
+ }
+
+ goto next_rec;
+ }
+
ib::error() << err_msg;
if (ignore_err & DICT_ERR_IGNORE_CORRUPT) {
goto next_rec;
@@ -2255,6 +2292,12 @@ static const char* dict_load_table_low(const table_name_t& name,
(*table)->id = table_id;
(*table)->file_unreadable = !!(flags2 & DICT_TF2_DISCARDED);
+ ulint len;
+ (*table)->def_trx_id = mach_read_from_6(
+ rec_get_nth_field_old(rec, DICT_FLD__SYS_TABLES__DB_TRX_ID,
+ &len));
+ ut_ad(len == DATA_TRX_ID_LEN);
+ static_assert(DATA_TRX_ID_LEN == 6, "compatibility");
return(NULL);
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 419f3cbdb21..682a0ff3741 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1644,6 +1644,40 @@ static void wsrep_abort_transaction(handlerton*, THD *, THD *, my_bool);
static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid);
static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid);
#endif /* WITH_WSREP */
+
+ulonglong ha_innobase::table_version() const
+{
+ /* This is either "garbage" or something that was assigned
+ on a successful ha_innobase::prepare_inplace_alter_table(). */
+ return m_prebuilt->trx_id;
+}
+
+static int innodb_check_version(handlerton *hton, const char *path,
+ const LEX_CUSTRING *version,
+ ulonglong create_id)
+{
+ DBUG_ENTER("innodb_check_version");
+ DBUG_ASSERT(hton == innodb_hton_ptr);
+
+ if (!create_id)
+ DBUG_RETURN(0);
+
+ char norm_path[FN_REFLEN];
+ normalize_table_name(norm_path, path);
+
+ if (dict_table_t *table= dict_table_open_on_name(norm_path, false, false,
+ DICT_ERR_IGNORE_NONE))
+ {
+ const trx_id_t trx_id= table->def_trx_id;
+ DBUG_ASSERT(trx_id <= create_id);
+ dict_table_close(table, false, false);
+ DBUG_PRINT("info", ("create_id: %llu trx_id: %llu", create_id, trx_id));
+ DBUG_RETURN(create_id != trx_id);
+ }
+ else
+ DBUG_RETURN(2);
+}
+
/********************************************************************//**
Converts an InnoDB error code to a MySQL error code and also tells to MySQL
about a possible transaction rollback inside InnoDB caused by a lock wait
@@ -3704,6 +3738,8 @@ static int innodb_init(void* p)
innobase_hton->get_checkpoint=innobase_wsrep_get_checkpoint;
#endif /* WITH_WSREP */
+ innobase_hton->check_version = innodb_check_version;
+
innobase_hton->tablefile_extensions = ha_innobase_exts;
innobase_hton->table_options = innodb_table_option_list;
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 2d09df685b5..11abd9068c6 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -59,6 +59,10 @@ public:
ha_innobase(handlerton* hton, TABLE_SHARE* table_arg);
~ha_innobase() override;
+ /** @return the transaction that last modified the table definition
+ @see dict_table_t::def_trx_id */
+ ulonglong table_version() const override;
+
/** Get the row type from the storage engine. If this method returns
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used. */
enum row_type get_row_type() const override;
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 87bb4ea9cff..38b7c9f3915 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -832,7 +832,7 @@ inline void dict_table_t::rollback_instant(
struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
{
/** Dummy query graph */
- que_thr_t* thr;
+ que_thr_t*const thr;
/** The prebuilt struct of the creating instance */
row_prebuilt_t*& prebuilt;
/** InnoDB indexes being created */
@@ -854,9 +854,9 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
/** number of InnoDB foreign key constraints being dropped */
const ulint num_to_add_fk;
/** whether to create the indexes online */
- bool online;
+ const bool online;
/** memory heap */
- mem_heap_t* heap;
+ mem_heap_t* const heap;
/** dictionary transaction */
trx_t* trx;
/** original table (if rebuilt, differs from indexed_table) */
@@ -941,12 +941,15 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
bool page_compressed,
ulonglong page_compression_level_arg) :
inplace_alter_handler_ctx(),
+ thr (pars_complete_graph_for_exec(nullptr, prebuilt_arg->trx,
+ heap_arg, prebuilt_arg)),
prebuilt (prebuilt_arg),
add_index (0), add_key_numbers (0), num_to_add_index (0),
drop_index (drop_arg), num_to_drop_index (num_to_drop_arg),
drop_fk (drop_fk_arg), num_to_drop_fk (num_to_drop_fk_arg),
add_fk (add_fk_arg), num_to_add_fk (num_to_add_fk_arg),
- online (online_arg), heap (heap_arg), trx (0),
+ online (online_arg), heap (heap_arg),
+ trx (innobase_trx_allocate(prebuilt_arg->trx->mysql_thd)),
old_table (prebuilt_arg->table),
new_table (new_table_arg), instant_table (0),
col_map (0), col_names (col_names_arg),
@@ -993,8 +996,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
}
#endif /* UNIV_DEBUG */
- thr = pars_complete_graph_for_exec(NULL, prebuilt->trx, heap,
- prebuilt);
+ trx_start_for_ddl(trx, TRX_DICT_OP_INDEX);
}
~ha_innobase_inplace_ctx()
@@ -6236,6 +6238,7 @@ prepare_inplace_alter_table_dict(
* sizeof *ctx->add_key_numbers));
/* Acquire a lock on the table before creating any indexes. */
+ bool table_lock_failed = false;
if (ctx->online) {
error = DB_SUCCESS;
@@ -6244,17 +6247,11 @@ prepare_inplace_alter_table_dict(
ctx->prebuilt->trx, ctx->new_table, LOCK_S);
if (error != DB_SUCCESS) {
-
+ table_lock_failed = true;
goto error_handling;
}
}
- /* Create a background transaction for the operations on
- the data dictionary tables. */
- ctx->trx = innobase_trx_allocate(ctx->prebuilt->trx->mysql_thd);
-
- trx_start_for_ddl(ctx->trx, TRX_DICT_OP_INDEX);
-
/* Latch the InnoDB data dictionary exclusively so that no deadlocks
or lock waits can happen in it during an index create operation. */
@@ -7093,6 +7090,8 @@ op_ok:
fts_sync_during_ddl(ctx->old_table);
}
+ trx_start_for_ddl(ctx->trx, TRX_DICT_OP_INDEX);
+
error_handling:
/* After an error, remove all those index definitions from the
dictionary which were defined. */
@@ -7122,14 +7121,12 @@ error_handling:
error_handled:
ctx->prebuilt->trx->error_info = NULL;
-
- if (!ctx->trx) {
- goto err_exit;
- }
-
ctx->trx->error_state = DB_SUCCESS;
if (!dict_locked) {
+ if (table_lock_failed) {
+ goto err_exit;
+ }
row_mysql_lock_data_dictionary(ctx->trx);
}
@@ -7189,7 +7186,7 @@ err_exit:
if (ctx->trx) {
row_mysql_unlock_data_dictionary(ctx->trx);
-
+ ctx->trx->rollback();
ctx->trx->free();
}
trx_commit_for_mysql(ctx->prebuilt->trx);
@@ -8113,6 +8110,15 @@ err_exit:
DBUG_RETURN(true);
}
+success:
+ /* Memorize the future transaction ID for committing
+ the data dictionary change, to be reported by
+ ha_innobase::table_version(). */
+ m_prebuilt->trx_id = (ha_alter_info->handler_flags
+ & ~INNOBASE_INPLACE_IGNORE)
+ ? static_cast<ha_innobase_inplace_ctx*>
+ (ha_alter_info->handler_ctx)->trx->id
+ : 0;
DBUG_RETURN(false);
}
@@ -8216,12 +8222,16 @@ found_col:
ha_alter_info->ignore || !thd_is_strict_mode(m_user_thd),
alt_opt.page_compressed, alt_opt.page_compression_level);
- DBUG_RETURN(prepare_inplace_alter_table_dict(
- ha_alter_info, altered_table, table,
- table_share->table_name.str,
- info.flags(), info.flags2(),
- fts_doc_col_no, add_fts_doc_id,
- add_fts_doc_id_idx));
+ if (!prepare_inplace_alter_table_dict(
+ ha_alter_info, altered_table, table,
+ table_share->table_name.str,
+ info.flags(), info.flags2(),
+ fts_doc_col_no, add_fts_doc_id,
+ add_fts_doc_id_idx)) {
+ goto success;
+ }
+
+ DBUG_RETURN(true);
}
/** Check that the column is part of a virtual index(index contains
@@ -8695,20 +8705,21 @@ rollback_inplace_alter_table(
DBUG_ENTER("rollback_inplace_alter_table");
- if (!ctx || !ctx->trx) {
+ if (!ctx) {
/* If we have not started a transaction yet,
(almost) nothing has been or needs to be done. */
goto func_exit;
}
- trx_start_for_ddl(ctx->trx, ctx->need_rebuild()
- ? TRX_DICT_OP_TABLE : TRX_DICT_OP_INDEX);
row_mysql_lock_data_dictionary(ctx->trx);
if (ctx->need_rebuild()) {
+ trx_set_dict_operation(ctx->trx, TRX_DICT_OP_TABLE);
/* DML threads can access ctx->new_table via the
online rebuild log. Free it first. */
innobase_online_rebuild_log_free(prebuilt->table);
+ } else if (trx_get_dict_operation(ctx->trx) == TRX_DICT_OP_NONE) {
+ trx_set_dict_operation(ctx->trx, TRX_DICT_OP_INDEX);
}
if (!ctx->new_table) {
@@ -11010,12 +11021,6 @@ ha_innobase::commit_inplace_alter_table(
}
}
- if (!trx) {
- DBUG_ASSERT(!new_clustered);
- trx = innobase_trx_allocate(m_user_thd);
- }
-
- trx_start_for_ddl(trx, TRX_DICT_OP_INDEX);
/* Latch the InnoDB data dictionary exclusively so that no deadlocks
or lock waits can happen in it during the data dictionary operation. */
row_mysql_lock_data_dictionary(trx);
@@ -11282,6 +11287,7 @@ foreign_fail:
= static_cast<ha_innobase_inplace_ctx*>(*pctx);
if (ctx->trx) {
+ ctx->trx->rollback();
ctx->trx->free();
ctx->trx = NULL;
}
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 9d130a934fe..2668a920b30 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -5266,14 +5266,19 @@ i_s_dict_fill_sys_indexes(
fields = table_to_fill->field;
- if (*index->name == *TEMP_INDEX_PREFIX_STR) {
+ char* name = const_cast<char*>(index->name());
+
+ if (*name == *TEMP_INDEX_PREFIX_STR) {
+ if (name[1] == *TEMP_INDEX_PREFIX_STR) {
+ name++;
+ }
+
/* Since TEMP_INDEX_PREFIX_STR is not valid UTF-8, we
need to convert it to something else. */
- *const_cast<char*>(index->name()) = '?';
+ *name = '?';
}
- OK(fields[SYS_INDEX_NAME]->store(index->name,
- uint(strlen(index->name)),
+ OK(fields[SYS_INDEX_NAME]->store(name, uint(strlen(name)),
system_charset_info));
OK(fields[SYS_INDEX_ID]->store(longlong(index->id), true));
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 2d87d7f689f..022c234a5d5 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -2166,15 +2166,17 @@ public:
foreign key checks running on it. */
Atomic_counter<int32_t> n_foreign_key_checks_running;
- /** Transaction id that last touched the table definition. Either when
- loading the definition or CREATE TABLE, or ALTER TABLE (prepare,
- commit, and rollback phases). */
- trx_id_t def_trx_id;
- /** Last transaction that inserted into an empty table.
- Updated while holding exclusive table lock and an exclusive
- latch on the clustered index root page (which must also be
- an empty leaf page), and an ahi_latch (if btr_search_enabled). */
- Atomic_relaxed<trx_id_t> bulk_trx_id;
+ /** DDL transaction that last touched the table definition, or 0 if
+ no history is available. This includes possible changes in
+ ha_innobase::prepare_inplace_alter_table() and
+ ha_innobase::commit_inplace_alter_table(). */
+ trx_id_t def_trx_id;
+
+ /** Last transaction that inserted into an empty table.
+ Updated while holding exclusive table lock and an exclusive
+ latch on the clustered index root page (which must also be
+ an empty leaf page), and an ahi_latch (if btr_search_enabled). */
+ Atomic_relaxed<trx_id_t> bulk_trx_id;
/*!< set of foreign key constraints in the table; these refer to
columns in other tables */
@@ -2370,9 +2372,9 @@ public:
/** Timestamp of the last modification of this table. */
Atomic_relaxed<time_t> update_time;
/** Transactions whose view low limit is greater than this number are
- not allowed to store to the query cache or retrieve from it.
- When a trx with undo logs commits, it sets this to the value of the
- transaction id. */
+ not allowed to access the MariaDB query cache.
+ @see innobase_query_caching_table_check_low()
+ @see trx_t::commit_tables() */
Atomic_relaxed<trx_id_t> query_cache_inv_trx_id;
#ifdef UNIV_DEBUG
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index 9890a9224f8..a7404f204db 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -989,8 +989,9 @@ public:
inline void release_locks();
/** Evict a table definition due to the rollback of ALTER TABLE.
- @param[in] table_id table identifier */
- void evict_table(table_id_t table_id);
+ @param table_id table identifier
+ @param reset_only whether to only reset dict_table_t::def_trx_id */
+ void evict_table(table_id_t table_id, bool reset_only= false);
/** Initiate rollback.
@param savept savepoint to which to roll back
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 0bb8f4cefba..c4c073c7c2c 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -3919,8 +3919,11 @@ row_merge_drop_indexes(
/* Invalidate all row_prebuilt_t::ins_graph that are referring
to this table. That is, force row_get_prebuilt_insert_row() to
rebuild prebuilt->ins_node->entry_list). */
- ut_ad(table->def_trx_id <= trx->id);
- table->def_trx_id = trx->id;
+ if (table->def_trx_id < trx->id) {
+ table->def_trx_id = trx->id;
+ } else {
+ ut_ad(table->def_trx_id == trx->id || table->name.part());
+ }
next_index = dict_table_get_next_index(index);
@@ -4152,7 +4155,7 @@ row_merge_rename_index_to_add(
static const char rename_index[] =
"PROCEDURE RENAME_INDEX_PROC () IS\n"
"BEGIN\n"
- "UPDATE SYS_INDEXES SET NAME=SUBSTR(NAME,1,LENGTH(NAME)-1)\n"
+ "UPDATE SYS_INDEXES SET NAME=SUBSTR(NAME,2,LENGTH(NAME)-2)\n"
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index cc648f0f2e1..baa52c31bf9 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2713,6 +2713,7 @@ row_mysql_drop_garbage_tables()
heap,
reinterpret_cast<const char*>(field), len);
if (strstr(table_name, "/" TEMP_FILE_PREFIX "-") &&
+ !strstr(table_name, "/" TEMP_FILE_PREFIX "-alter-") &&
!strstr(table_name, "/" TEMP_FILE_PREFIX "-backup-") &&
!strstr(table_name, "/" TEMP_FILE_PREFIX "-exchange-"))
{
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 0fdc1763eb4..5e4f4762707 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -105,7 +105,8 @@ row_purge_remove_clust_if_poss_low(
ulint mode) /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
{
dict_index_t* index = dict_table_get_first_index(node->table);
-
+ table_id_t table_id = 0;
+retry:
log_free_check();
mtr_t mtr;
@@ -118,12 +119,38 @@ row_purge_remove_clust_if_poss_low(
return true;
}
+ rec_t* rec = btr_pcur_get_rec(&node->pcur);
+
if (node->table->id == DICT_INDEXES_ID) {
/* If this is a record of the SYS_INDEXES table, then
we have to free the file segments of the index tree
associated with the index */
+ if (!table_id) {
+ /* Ensure that the dict_table_t::def_trx_id
+ will be recovered correctly for
+ innodb_check_version(), even if the only
+ operation is DROP INDEX */
+ static_assert(!DICT_FLD__SYS_INDEXES__TABLE_ID,
+ "compatibility");
+ table_id = mach_read_from_8(rec);
+ ut_ad(table_id);
+ if (UNIV_LIKELY(table_id)) {
+ mtr.commit();
+ MDL_ticket* mdl= nullptr;
+ if (dict_table_t* t = dict_table_open_on_id(
+ table_id, false,
+ DICT_TABLE_OP_LOAD_TABLESPACE,
+ node->purge_thd, &mdl)) {
+ dict_table_close(t, false, false,
+ node->purge_thd, mdl);
+ }
+ goto retry;
+ }
+ }
+
dict_drop_index_tree(&node->pcur, nullptr, &mtr);
mtr.commit();
+ log_free_check();
mtr.start();
index->set_modified(mtr);
@@ -131,9 +158,10 @@ row_purge_remove_clust_if_poss_low(
mtr.commit();
return true;
}
+
+ rec = btr_pcur_get_rec(&node->pcur);
}
- rec_t* rec = btr_pcur_get_rec(&node->pcur);
rec_offs offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
mem_heap_t* heap = NULL;
@@ -661,12 +689,50 @@ row_purge_del_mark(
return(row_purge_remove_clust_if_poss(node));
}
+/** Try to extract a table identifier from a record, so that
+dict_table_t::def_trx_id can be recovered for innodb_check_version().
+@param id table identifier
+@param rec clustered index record
+@return user table identifier
+@retval 0 if id does not refer to SYS_TABLES, SYS_INDEXES, SYS_COLUMNS */
+static table_id_t row_purge_get_table_id(table_id_t id, const rec_t *rec)
+{
+ unsigned table_id_field;
+
+ switch (id)
+ {
+ default:
+ return 0;
+ case DICT_TABLES_ID:
+ table_id_field= DICT_FLD__SYS_TABLES__ID;
+ break;
+ case DICT_COLUMNS_ID:
+ case DICT_INDEXES_ID:
+ static_assert(!DICT_FLD__SYS_COLUMNS__TABLE_ID, "compatibility");
+ static_assert(!DICT_FLD__SYS_INDEXES__TABLE_ID, "compatibility");
+ table_id_field= 0;
+ }
+
+ ulint len;
+ const byte* field= rec_get_nth_field_old(rec, table_id_field, &len);
+ if (UNIV_UNLIKELY(len != 8))
+ {
+ ut_ad("corrupted SYS_ table" == 0);
+ return 0;
+ }
+ const table_id_t table_id= mach_read_from_8(field);
+ ut_ad(table_id);
+ return table_id;
+}
+
/** Reset DB_TRX_ID, DB_ROLL_PTR of a clustered index record
whose old history can no longer be observed.
@param[in,out] node purge node
@param[in,out] mtr mini-transaction (will be started and committed) */
static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr)
{
+ table_id_t table_id = 0;
+retry:
/* Reset DB_TRX_ID, DB_ROLL_PTR for old records. */
mtr->start();
@@ -701,6 +767,20 @@ static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr)
ut_ad(!rec_get_deleted_flag(
rec, rec_offs_comp(offsets))
|| rec_is_alter_metadata(rec, *index));
+ if (!table_id && (table_id = row_purge_get_table_id(
+ node->table->id, rec))) {
+ mtr->commit();
+ MDL_ticket* mdl= nullptr;
+ if (dict_table_t* t = dict_table_open_on_id(
+ table_id, false,
+ DICT_TABLE_OP_LOAD_TABLESPACE,
+ node->purge_thd, &mdl)) {
+ dict_table_close(t, false, false,
+ node->purge_thd, mdl);
+ }
+ goto retry;
+ }
+
DBUG_LOG("purge", "reset DB_TRX_ID="
<< ib::hex(row_get_rec_trx_id(
rec, index, offsets)));
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index 0818a35c480..f69fa01794b 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -389,7 +389,8 @@ static bool row_undo_ins_parse_undo_rec(undo_node_t* node, bool dict_locked)
case TRX_UNDO_RENAME_TABLE:
dict_table_t* table = node->table;
ut_ad(!table->is_temporary());
- ut_ad(dict_table_is_file_per_table(table)
+ ut_ad(table->file_unreadable
+ || dict_table_is_file_per_table(table)
== !is_system_tablespace(table->space_id));
size_t len = mach_read_from_2(node->undo_rec)
+ size_t(node->undo_rec - ptr) - 2;
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index 462563de540..e317fb23f16 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -157,21 +157,43 @@ row_undo_mod_clust_low(
}
}
- if (err == DB_SUCCESS
- && btr_cur_get_index(btr_cur)->table->id == DICT_COLUMNS_ID) {
+ if (err != DB_SUCCESS) {
+ return err;
+ }
+
+ switch (const auto id = btr_cur_get_index(btr_cur)->table->id) {
+ unsigned c;
+ case DICT_TABLES_ID:
+ if (node->trx != trx_roll_crash_recv_trx) {
+ break;
+ }
+ c = DICT_COL__SYS_TABLES__ID;
+ goto evict;
+ case DICT_INDEXES_ID:
+ if (node->trx != trx_roll_crash_recv_trx) {
+ break;
+ }
+ /* fall through */
+ case DICT_COLUMNS_ID:
+ static_assert(!DICT_COL__SYS_INDEXES__TABLE_ID, "");
+ static_assert(!DICT_COL__SYS_COLUMNS__TABLE_ID, "");
+ c = DICT_COL__SYS_COLUMNS__TABLE_ID;
/* This is rolling back an UPDATE or DELETE on SYS_COLUMNS.
If it was part of an instant ALTER TABLE operation, we
must evict the table definition, so that it can be
reloaded after the dictionary operation has been
completed. At this point, any corresponding operation
to the metadata record will have been rolled back. */
- const dfield_t& table_id = *dtuple_get_nth_field(node->row, 0);
+ evict:
+ const dfield_t& table_id = *dtuple_get_nth_field(node->row, c);
ut_ad(dfield_get_len(&table_id) == 8);
- node->trx->evict_table(mach_read_from_8(static_cast<byte*>(
- table_id.data)));
+ node->trx->evict_table(mach_read_from_8(
+ static_cast<byte*>(
+ table_id.data)),
+ id == DICT_COLUMNS_ID);
}
- return(err);
+ return DB_SUCCESS;
}
/** Get the byte offset of the DB_TRX_ID column
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 1a0c8dd4868..47c963139bb 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1245,8 +1245,9 @@ inline void trx_t::commit_tables()
}
/** Evict a table definition due to the rollback of ALTER TABLE.
-@param[in] table_id table identifier */
-void trx_t::evict_table(table_id_t table_id)
+@param table_id table identifier
+@param reset_only whether to only reset dict_table_t::def_trx_id */
+void trx_t::evict_table(table_id_t table_id, bool reset_only)
{
ut_ad(in_rollback);
@@ -1256,6 +1257,8 @@ void trx_t::evict_table(table_id_t table_id)
return;
}
+ table->def_trx_id = 0;
+
if (!table->release()) {
/* This must be a DDL operation that is being rolled
back in an active connection. */
@@ -1265,6 +1268,10 @@ void trx_t::evict_table(table_id_t table_id)
return;
}
+ if (reset_only) {
+ return;
+ }
+
/* This table should only be locked by this transaction, if at all. */
ut_ad(UT_LIST_GET_LEN(table->locks) <= 1);
const bool locked = UT_LIST_GET_LEN(table->locks);
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 6c46fe7bffc..496b920208b 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -224,6 +224,12 @@ static handler *rocksdb_create_handler(my_core::handlerton *hton,
my_core::TABLE_SHARE *table_arg,
my_core::MEM_ROOT *mem_root);
+void save_table_version(rocksdb::WriteBatch *wb, const char *path,
+ ulonglong version);
+ulonglong get_table_version(const char *path);
+void delete_table_version(rocksdb::WriteBatch *wb,
+ const char *path);
+
static rocksdb::CompactRangeOptions getCompactRangeOptions(
int concurrency = 0) {
rocksdb::CompactRangeOptions compact_range_options;
@@ -5200,6 +5206,18 @@ static rocksdb::Status check_rocksdb_options_compatibility(
bool prevent_myrocks_loading= false;
+static int rocksdb_check_version(handlerton *hton,
+ const char *path,
+ const LEX_CUSTRING *version,
+ ulonglong create_id) {
+ ulonglong ver= get_table_version(path);
+ DBUG_PRINT("note",
+ ("MYROCKS-VER: rocksdb_check_version(): path: %s create_id: %llu "
+ "on_disk_create_id: %llu",
+ path, create_id, ver));
+
+ return (create_id == ver);
+}
/*
Storage Engine initialization function, invoked when plugin is loaded.
*/
@@ -5319,6 +5337,7 @@ static int rocksdb_init_func(void *const p) {
rocksdb_hton->handle_single_table_select = rocksdb_handle_single_table_select;
*/
+ rocksdb_hton->check_version = rocksdb_check_version;
rocksdb_hton->flags = HTON_TEMPORARY_NOT_SUPPORTED |
HTON_SUPPORTS_EXTENDED_KEYS | HTON_CAN_RECREATE;
@@ -7739,6 +7758,7 @@ int ha_rocksdb::create_table(const std::string &table_name,
goto error;
}
+ save_table_version(batch, table_arg->s->path.str, 0);
err = dict_manager.commit(batch);
if (err != HA_EXIT_SUCCESS) {
dict_manager.unlock();
@@ -11336,6 +11356,8 @@ ulonglong ha_rocksdb::table_flags() const
- have no PK
- have some (or all) of PK that can't be decoded from the secondary
index.
+ HA_REUSES_FILE_NAMES
+ - Ensures that there is a .frm file when table is dropped or renamed.
*/
THD *thd= ha_thd();
DBUG_RETURN(HA_BINLOG_ROW_CAPABLE |
@@ -11344,7 +11366,7 @@ ulonglong ha_rocksdb::table_flags() const
HA_REC_NOT_IN_SEQ | HA_CAN_INDEX_BLOBS |
HA_PRIMARY_KEY_IN_READ_INDEX |
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_NULL_IN_KEY |
- HA_PARTIAL_COLUMN_READ |
+ HA_PARTIAL_COLUMN_READ | HA_REUSES_FILE_NAMES |
HA_TABLE_SCAN_ON_INDEX);
}
@@ -11687,11 +11709,14 @@ int ha_rocksdb::delete_table(Rdb_tbl_def *const tbl) {
dict_manager.add_drop_table(tbl->m_key_descr_arr, tbl->m_key_count, batch);
+ std::string path = std::string("./") + tbl->base_dbname() +
+ "/" + tbl->base_tablename();
/*
Remove the table entry in data dictionary (this will also remove it from
the persistent data dictionary).
*/
ddl_manager.remove(tbl, batch, true);
+ delete_table_version(batch, path.c_str());
int err = dict_manager.commit(batch);
if (err) {
@@ -13035,6 +13060,13 @@ bool ha_rocksdb::commit_inplace_alter_table(
ddl_manager.remove_uncommitted_keydefs(ctx->m_added_indexes);
}
+ /*
+ Increment the table version.
+ */
+ ulonglong table_ver = get_table_version(table->s->path.str);
+ table_ver++;
+ save_table_version(batch, table->s->path.str, table_ver);
+
if (dict_manager.commit(batch)) {
/*
Should never reach here. We assume MyRocks will abort if commit fails.
@@ -14572,6 +14604,72 @@ void ha_rocksdb::print_error(int error, myf errflag) {
handler::print_error(error, errflag);
}
+
+std::string make_table_version_lookup_key(const char *path) {
+ std::string res;
+ res.append("MariaDB:table-version:");
+ res.append(path);
+ return res;
+}
+
+
+/*
+ Save the table version in the data dictionary
+
+ @param wb Where to write
+ @param path Table's path "./db_name/table_name"
+ @param version Version
+*/
+
+void save_table_version(rocksdb::WriteBatch *wb, const char *path,
+ ulonglong version) {
+ ulonglong val= htobe64(version);
+ auto lookup_key = make_table_version_lookup_key(path);
+ wb->Put(dict_manager.get_system_cf(), lookup_key,
+ rocksdb::Slice((const char*)&val, sizeof(val)));
+}
+
+/*
+ @brief Read table's version from the data dictionary
+
+ @param path The table's path, "./db_name/table_name"
+
+ @return
+ number TTable version as stored in the data dictionary
+ 0 If there's no table version stored.
+ -1 Read error
+*/
+
+ulonglong get_table_version(const char *path) {
+ auto lookup_key = make_table_version_lookup_key(path);
+ std::string value;
+ ulonglong res;
+
+ auto s = dict_manager.get_value(rocksdb::Slice(lookup_key), &value);
+ if (s.IsNotFound()) {
+ res = 0;
+ } else if (s.ok()) {
+ // decode the value
+ if (value.length() == sizeof(res)) {
+ memcpy(&res, value.data(), sizeof(res));
+ res = be64toh(res);
+ }
+ else
+ res = ulonglong(-1);
+ } else {
+ res = ulonglong(-1);
+ }
+ return res;
+}
+
+void delete_table_version(rocksdb::WriteBatch *wb, const char *path) {
+ auto lookup_key = make_table_version_lookup_key(path);
+ wb->Delete(dict_manager.get_system_cf(), lookup_key);
+}
+
+ulonglong ha_rocksdb::table_version() const {
+ return get_table_version(table->s->path.str);
+}
std::string rdb_corruption_marker_file_name() {
std::string ret(rocksdb_datadir);
ret.append("/ROCKSDB_CORRUPTED");
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h
index 05b5341bfb1..05f0b2bf984 100644
--- a/storage/rocksdb/ha_rocksdb.h
+++ b/storage/rocksdb/ha_rocksdb.h
@@ -973,6 +973,9 @@ public:
my_core::Alter_inplace_info *const ha_alter_info, bool commit) override;
void set_skip_unique_check_tables(const char *const whitelist);
+
+ virtual ulonglong table_version() const override;
+
#ifdef MARIAROCKS_NOT_YET // MDEV-10976
bool is_read_free_rpl_table() const;
#endif