Debian Codegraph @

mysql-test/suite/innodb/t/flush-hang.test

raw
1
2 --echo #
3 --echo #Bug #21133329 HANGING "SYSTEM LOCK" WHEN EXECUTING "FLUSH TABLE ... FOR EXPORT"
4 --echo #
5
6 --source include/have_debug.inc
7
8 CREATE TABLE t1 (
9 c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
10 c2 BIGINT,
11 c3 VARCHAR(2048),
12 c4 VARCHAR(2048),
13 INDEX idx1(c2),
14 INDEX idx2(c3(512)),
15 INDEX idx3(c4(512))) Engine=InnoDB charset latin1;
16
17 CREATE TABLE t2 ( f1 int PRIMARY KEY) engine=innodb;
18
19 # Stop purge so that it doesn't remove the delete marked entries.
20 SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
21
22 # Disable change buffer merge from the master thread, additionally
23 # enable aggressive flushing so that more changes are buffered.
24 SET GLOBAL innodb_disable_background_merge=ON;
25 SET GLOBAL innodb_stats_persistent=OFF;
26 show variables like '%innodb_stats_persistent%';
27
28 INSERT INTO t1(c2, c3, c4) VALUES
29 (1, REPEAT('a', 2048), REPEAT('a', 2048)),
30 (2, REPEAT('b', 2048), REPEAT('b', 2048)),
31 (3, REPEAT('c', 2048), REPEAT('c', 2048)),
32 (4, REPEAT('d', 2048), REPEAT('d', 2048));
33
34 INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
35 INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
36 INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
37 INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
38 INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
39 INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
40
41 FLUSH TABLES t2 FOR EXPORT;
42 UNLOCK TABLES;
43
44 SET GLOBAL innodb_disable_background_merge=OFF;
45 SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
46 SET GLOBAL innodb_stats_persistent=ON;
47
48 DROP TABLE t1,t2;