Skip to content

Commit 0c405b0

Browse files
committed
MDEV-18009: Clean up the test case
Avoid accessing the table cache while the ALTER TABLE statement is blocked by DEBUG_SYNC. Use explicit COMMIT for forcing the redo log flush (whose main purpose is to ensure that the incomplete state of the blocked ALTER TABLE statement is persisted).
1 parent 646a3bd commit 0c405b0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mysql-test/suite/innodb/r/instant_alter_crash.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ CREATE TABLE t1(id INT PRIMARY KEY, c2 INT UNIQUE)
66
ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
77
CREATE TABLE t2 LIKE t1;
88
INSERT INTO t1 VALUES(0,2);
9-
BEGIN;
109
INSERT INTO t2 VALUES(2,1);
1110
ALTER TABLE t2 ADD COLUMN (c3 TEXT NOT NULL DEFAULT 'De finibus bonorum');
11+
BEGIN;
12+
INSERT INTO t2 VALUES(3,4,'accusantium doloremque laudantium');
1213
connect ddl, localhost, root;
1314
SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
1415
ALTER TABLE t1 ADD COLUMN (c3 TEXT NOT NULL DEFAULT ' et malorum');
1516
connection default;
1617
SET DEBUG_SYNC='now WAIT_FOR ddl';
1718
SET GLOBAL innodb_flush_log_at_trx_commit=1;
18-
INSERT INTO t2 VALUES(3,4,'accusantium doloremque laudantium');
19+
COMMIT;
1920
# Kill the server
2021
disconnect ddl;
2122
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;

mysql-test/suite/innodb/t/instant_alter_crash.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ CREATE TABLE t1(id INT PRIMARY KEY, c2 INT UNIQUE)
1717
ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
1818
CREATE TABLE t2 LIKE t1;
1919
INSERT INTO t1 VALUES(0,2);
20-
BEGIN;
2120
INSERT INTO t2 VALUES(2,1);
2221
ALTER TABLE t2 ADD COLUMN (c3 TEXT NOT NULL DEFAULT 'De finibus bonorum');
22+
BEGIN;
23+
INSERT INTO t2 VALUES(3,4,'accusantium doloremque laudantium');
2324

2425
connect ddl, localhost, root;
2526
SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
@@ -29,7 +30,7 @@ ALTER TABLE t1 ADD COLUMN (c3 TEXT NOT NULL DEFAULT ' et malorum');
2930
connection default;
3031
SET DEBUG_SYNC='now WAIT_FOR ddl';
3132
SET GLOBAL innodb_flush_log_at_trx_commit=1;
32-
INSERT INTO t2 VALUES(3,4,'accusantium doloremque laudantium');
33+
COMMIT;
3334

3435
--source include/kill_mysqld.inc
3536
disconnect ddl;

0 commit comments

Comments
 (0)