summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/instant_alter_purge.result
blob: 8adae3d645f0b8ffadccd9465d0652ff66c61a6d (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
38
39
40
41
42
43
44
45
46
47
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
#
# MDEV-17793 Crash in purge after instant DROP and emptying the table
#
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;
InnoDB		1 transactions not purged
ALTER TABLE t1 DROP extra;
disconnect prevent_purge;
InnoDB		0 transactions not purged
DROP TABLE t1;
#
# MDEV-17813 Crash in instant ALTER TABLE due to purge
# concurrently emptying table
#
CREATE TABLE t1 (f2 INT) ENGINE=InnoDB;
INSERT INTO t1 SET f2=1;
ALTER TABLE t1 ADD COLUMN f1 INT;
connect  purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1;
SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL go WAIT_FOR do';
ALTER TABLE t1 ADD COLUMN f3 INT;
connection purge_control;
SET DEBUG_SYNC='now WAIT_FOR go';
COMMIT;
SET GLOBAL innodb_max_purge_lag_wait= 0;
InnoDB		0 transactions not purged
SET DEBUG_SYNC='now SIGNAL do';
disconnect purge_control;
connection default;
SET DEBUG_SYNC=RESET;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;