Debian Codegraph @

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

raw
1 # Bug #59641 Prepared XA transaction causes shutdown hang after a crash
2
3
4 CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
5 INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
6 COMMIT;
7 XA START '123';
8 INSERT INTO t VALUES(1,1);
9 XA END '123';
10 XA PREPARE '123';
11
12 CONNECT (con1,localhost,root,,);
13 CONNECTION con1;
14
15 XA START '456';
16 INSERT INTO t VALUES(3,47),(5,67);
17 UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
18 XA END '456';
19 XA PREPARE '456';
20
21 CONNECT (con2,localhost,root,,);
22 CONNECTION con2;
23
24 XA START '789';
25 UPDATE t SET b=4*a WHERE a=32;
26 XA END '789';
27 XA PREPARE '789';
28
29 CONNECT (con3,localhost,root,,);
30 CONNECTION con3;
31 # The server would issue this warning on restart.
32 call mtr.add_suppression("Found 3 prepared XA transactions");
33
34 --source include/kill_and_restart_mysqld.inc
35
36 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
37 SELECT * FROM t;
38 COMMIT;
39
40 # Shut down the server. This would hang because of the bug.
41 --source include/restart_mysqld.inc
42
43 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
44 SELECT * FROM t;
45 COMMIT;
46 --sorted_result
47 XA RECOVER;
48 XA ROLLBACK '123';
49 XA ROLLBACK '456';
50 XA COMMIT '789';
51 SELECT * FROM t;
52
53 DROP TABLE t;