1
DROP TABLE IF EXISTS bug_53756 ;
2
CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
3
ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
4
INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
6
# Select a less restrictive isolation level.
7
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
8
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
11
# Start a transaction in the default connection for isolation.
13
SELECT @@tx_isolation;
16
SELECT * FROM bug_53756;
23
# connection con1 deletes row 1
25
SELECT @@tx_isolation;
28
DELETE FROM bug_53756 WHERE pk=1;
30
# connection con2 deletes row 2
32
SELECT @@tx_isolation;
35
DELETE FROM bug_53756 WHERE pk=2;
37
# connection con3 updates row 3
39
SELECT @@tx_isolation;
42
UPDATE bug_53756 SET c1=77 WHERE pk=3;
44
# connection con4 updates row 4
46
SELECT @@tx_isolation;
49
UPDATE bug_53756 SET c1=88 WHERE pk=4;
51
# connection con5 inserts row 5
53
SELECT @@tx_isolation;
56
INSERT INTO bug_53756 VALUES(5, 55);
58
# connection con6 inserts row 6
60
SELECT @@tx_isolation;
63
INSERT INTO bug_53756 VALUES(6, 66);
65
# connection con1 commits.
68
# connection con3 commits.
71
# connection con4 rolls back.
74
# connection con6 rolls back.
77
# The connections 2 and 5 stay open.
79
# connection default selects resulting data.
80
# Delete of row 1 was committed.
81
# Update of row 3 was committed.
82
# Due to isolation level read committed, these should be included.
83
# All other changes should not be included.
84
SELECT * FROM bug_53756;
94
INSERT INTO bug_53756 VALUES (666,666);
95
SET SESSION debug="+d,crash_commit_before";
97
ERROR HY000: Lost connection to MySQL server during query
100
# disconnect con1, con2, con3, con4, con5, con6.
105
# Select recovered data.
106
# Delete of row 1 was committed.
107
# Update of row 3 was committed.
108
# These should be included.
109
# All other changes should not be included.
110
# Delete of row 2 and insert of row 5 should be rolled back
111
SELECT * FROM bug_53756;
118
DROP TABLE bug_53756;