1CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
2ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
3INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
4
5# Select a less restrictive isolation level.
6SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
7SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
8COMMIT;
9
10# Start a transaction in the default connection for isolation.
11START TRANSACTION;
12SELECT @@tx_isolation;
13@@tx_isolation
14READ-COMMITTED
15SELECT * FROM bug_53756;
16pk	c1
171	11
182	22
193	33
204	44
21connect  con1,localhost,root,,;
22START TRANSACTION;
23SELECT @@tx_isolation;
24@@tx_isolation
25READ-COMMITTED
26DELETE FROM bug_53756 WHERE pk=1;
27connect  con2,localhost,root,,;
28START TRANSACTION;
29SELECT @@tx_isolation;
30@@tx_isolation
31READ-COMMITTED
32DELETE FROM bug_53756 WHERE pk=2;
33connect  con3,localhost,root,,;
34START TRANSACTION;
35SELECT @@tx_isolation;
36@@tx_isolation
37READ-COMMITTED
38UPDATE bug_53756 SET c1=77 WHERE pk=3;
39connect  con4,localhost,root,,;
40START TRANSACTION;
41SELECT @@tx_isolation;
42@@tx_isolation
43READ-COMMITTED
44UPDATE bug_53756 SET c1=88 WHERE pk=4;
45connect  con5,localhost,root,,;
46START TRANSACTION;
47SELECT @@tx_isolation;
48@@tx_isolation
49READ-COMMITTED
50INSERT INTO bug_53756 VALUES(5, 55);
51connect  con6,localhost,root,,;
52START TRANSACTION;
53SELECT @@tx_isolation;
54@@tx_isolation
55READ-COMMITTED
56INSERT INTO bug_53756 VALUES(6, 66);
57connection con1;
58COMMIT;
59connection con3;
60COMMIT;
61connection con4;
62ROLLBACK;
63connection con6;
64ROLLBACK;
65
66# The connections 2 and 5 stay open.
67
68# Delete of row 1 was committed.
69# Update of row 3 was committed.
70# Due to isolation level read committed, these should be included.
71# All other changes should not be included.
72connection default;
73SELECT * FROM bug_53756;
74pk	c1
752	22
763	77
774	44
78START TRANSACTION;
79INSERT INTO bug_53756 VALUES (666,666);
80# restart
81disconnect con1;
82disconnect con2;
83disconnect con3;
84disconnect con4;
85disconnect con5;
86disconnect con6;
87#
88# Select recovered data.
89# Delete of row 1 was committed.
90# Update of row 3 was committed.
91# These should be included.
92# All other changes should not be included.
93# Delete of row 2 and insert of row 5 should be rolled back
94SELECT * FROM bug_53756;
95pk	c1
962	22
973	77
984	44
99DROP TABLE bug_53756;
100