summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/r/innodb-alter-tempfile.result')
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-tempfile.result40
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
new file mode 100644
index 00000000000..ce13ad0978b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result
@@ -0,0 +1,40 @@
+#
+# Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS
+#
+# Temporary tablename will be unique. This makes sure that future
+# in-place ALTERs of the same table will not be blocked due to
+# temporary tablename.
+# Crash the server in ha_innobase::commit_inplace_alter_table()
+CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
+SET debug='d,innodb_alter_commit_crash_before_commit';
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+# Write file to make mysql-test-run.pl expect crash
+# Execute the statement that causes the crash
+ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
+ERROR HY000: Lost connection to MySQL server during query
+# Startup the server after the crash
+# Read and remember the temporary table name
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+# Consecutive Alter table does not create same temporary file name
+ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
+# Shutdown the server to allow manual recovery
+# Manual recovery begin. The dictionary was not updated
+# and the files were not renamed. The rebuilt table
+# was left behind on purpose, to faciliate data recovery.
+# Manual recovery end
+# Startup the server after manual recovery
+# Drop the orphaned rebuilt table.
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ PRIMARY KEY (`f2`,`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;