| 1 |
# Not supported in embedded |
| 2 |
--source include/not_embedded.inc |
| 3 |
|
| 4 |
# This test case needs to crash the server. Needs a debug server. |
| 5 |
--source include/have_debug.inc |
| 6 |
|
| 7 |
# Don't test this under valgrind, memory leaks will occur. |
| 8 |
--source include/not_valgrind.inc |
| 9 |
|
| 10 |
# Avoid CrashReporter popup on Mac |
| 11 |
--source include/not_crashrep.inc |
| 12 |
|
| 13 |
--source include/innodb_page_size.inc |
| 14 |
|
| 15 |
--source include/have_debug_sync.inc |
| 16 |
|
| 17 |
call mtr.add_suppression("Cannot find index f2 in InnoDB index dictionary."); |
| 18 |
call mtr.add_suppression("InnoDB indexes are inconsistent with what defined in .frm for table"); |
| 19 |
call mtr.add_suppression("Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in"); |
| 20 |
call mtr.add_suppression("InnoDB could not find key no 1 with name f2 from dict cache for table"); |
| 21 |
|
| 22 |
|
| 23 |
--echo # |
| 24 |
--echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS |
| 25 |
--echo # |
| 26 |
--echo # Temporary tablename will be unique. This makes sure that future |
| 27 |
--echo # in-place ALTERs of the same table will not be blocked due to |
| 28 |
--echo # temporary tablename. |
| 29 |
|
| 30 |
let datadir= `select @@datadir`; |
| 31 |
|
| 32 |
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` |
| 33 |
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect |
| 34 |
|
| 35 |
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; |
| 36 |
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit'; |
| 37 |
|
| 38 |
--write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 39 |
|
| 40 |
--error 2013 |
| 41 |
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); |
| 42 |
|
| 43 |
--source include/start_mysqld.inc |
| 44 |
|
| 45 |
show create table t1; |
| 46 |
--echo # Consecutive Alter table does not create same temporary file name |
| 47 |
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); |
| 48 |
show create table t1; |
| 49 |
drop table t1; |
| 50 |
|
| 51 |
--echo # |
| 52 |
--echo # MDEV-22928 InnoDB fails to fetch index type |
| 53 |
--echo # when index mismatch |
| 54 |
--echo # |
| 55 |
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, |
| 56 |
index(f1), index(f2))ENGINE=InnoDB; |
| 57 |
INSERT INTO t1 VALUES(1, 1), (2, 2); |
| 58 |
|
| 59 |
connect (con1,localhost,root,,test); |
| 60 |
SET DEBUG_SYNC="alter_table_inplace_after_commit SIGNAL default_signal WAIT_FOR default_done"; |
| 61 |
--send |
| 62 |
ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE; |
| 63 |
connection default; |
| 64 |
set DEBUG_SYNC="now WAIT_FOR default_signal"; |
| 65 |
--let $shutdown_timeout=0 |
| 66 |
--source include/restart_mysqld.inc |
| 67 |
disconnect con1; |
| 68 |
# This may occasionally display records for a corrupted index(f2). |
| 69 |
# The original bug was about a crash during the execution of SHOW KEYS. |
| 70 |
--disable_result_log |
| 71 |
SHOW KEYS FROM t1; |
| 72 |
--enable_result_log |
| 73 |
DROP TABLE t1; |
| 74 |
remove_files_wildcard $datadir/test #sql-*.frm; |
| 75 |
|
| 76 |
--echo # |
| 77 |
--echo # MDEV-25503 InnoDB hangs on startup during recovery |
| 78 |
--echo # |
| 79 |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=1; |
| 80 |
connect (con1,localhost,root,,); |
| 81 |
BEGIN; |
| 82 |
DELETE FROM mysql.innodb_table_stats; |
| 83 |
|
| 84 |
connect (con2,localhost,root,,); |
| 85 |
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL blocked WAIT_FOR ever'; |
| 86 |
send ALTER TABLE t1 FORCE; |
| 87 |
|
| 88 |
connection default; |
| 89 |
SET DEBUG_SYNC='now WAIT_FOR blocked'; |
| 90 |
--let $shutdown_timeout=0 |
| 91 |
--source include/restart_mysqld.inc |
| 92 |
SELECT * FROM t1; |
| 93 |
DROP TABLE t1; |
| 94 |
remove_files_wildcard $datadir/test #sql-*.frm; |