summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/instant_alter_purge.test
blob: 9ccf3347d7b1543a56de104558460a8b1707d5e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--source include/have_innodb.inc
--source include/maybe_debug.inc
if ($have_debug) {
--source include/have_debug_sync.inc
}

SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;

--echo #
--echo # MDEV-17793 Crash in purge after instant DROP and emptying the table
--echo #

connect (prevent_purge,localhost,root);
START TRANSACTION WITH CONSISTENT SNAPSHOT;

connection default;
CREATE TABLE t1 (f1 INT, f2 INT) ENGINE=InnoDB;
INSERT INTO t1 () VALUES ();
ALTER TABLE t1 DROP f2, ADD COLUMN f2 INT;
ALTER TABLE t1 DROP f1;
DELETE FROM t1;

connection prevent_purge;
COMMIT;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;

ALTER TABLE t1 ADD COLUMN extra TINYINT UNSIGNED NOT NULL DEFAULT 42;
let $wait_all_purged= 1;
--source include/wait_all_purged.inc
ALTER TABLE t1 DROP extra;
disconnect prevent_purge;
let $wait_all_purged= 0;
--source include/wait_all_purged.inc
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;