~drizzle-developers/drizzle/elliott-release

« back to all changes in this revision

Viewing changes to plugin/innobase/tests/r/innodb_bug53756.result

  • Committer: Patrick Crews
  • Date: 2011-02-01 20:33:06 UTC
  • mfrom: (1845.2.288 drizzle)
  • Revision ID: gleebix@gmail.com-20110201203306-mwq2rk0it81tlwxh
Merged Trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
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);
5
 
 
6
 
# Select a less restrictive isolation level.
7
 
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
8
 
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
9
 
COMMIT;
10
 
 
11
 
# Start a transaction in the default connection for isolation.
12
 
START TRANSACTION;
13
 
SELECT @@tx_isolation;
14
 
@@tx_isolation
15
 
READ-COMMITTED
16
 
SELECT * FROM bug_53756;
17
 
pk      c1
18
 
1       11
19
 
2       22
20
 
3       33
21
 
4       44
22
 
 
23
 
# connection con1 deletes row 1
24
 
START TRANSACTION;
25
 
SELECT @@tx_isolation;
26
 
@@tx_isolation
27
 
READ-COMMITTED
28
 
DELETE FROM bug_53756 WHERE pk=1;
29
 
 
30
 
# connection con2 deletes row 2
31
 
START TRANSACTION;
32
 
SELECT @@tx_isolation;
33
 
@@tx_isolation
34
 
READ-COMMITTED
35
 
DELETE FROM bug_53756 WHERE pk=2;
36
 
 
37
 
# connection con3 updates row 3
38
 
START TRANSACTION;
39
 
SELECT @@tx_isolation;
40
 
@@tx_isolation
41
 
READ-COMMITTED
42
 
UPDATE bug_53756 SET c1=77 WHERE pk=3;
43
 
 
44
 
# connection con4 updates row 4
45
 
START TRANSACTION;
46
 
SELECT @@tx_isolation;
47
 
@@tx_isolation
48
 
READ-COMMITTED
49
 
UPDATE bug_53756 SET c1=88 WHERE pk=4;
50
 
 
51
 
# connection con5 inserts row 5
52
 
START TRANSACTION;
53
 
SELECT @@tx_isolation;
54
 
@@tx_isolation
55
 
READ-COMMITTED
56
 
INSERT INTO bug_53756 VALUES(5, 55);
57
 
 
58
 
# connection con6 inserts row 6
59
 
START TRANSACTION;
60
 
SELECT @@tx_isolation;
61
 
@@tx_isolation
62
 
READ-COMMITTED
63
 
INSERT INTO bug_53756 VALUES(6, 66);
64
 
 
65
 
# connection con1 commits.
66
 
COMMIT;
67
 
 
68
 
# connection con3 commits.
69
 
COMMIT;
70
 
 
71
 
# connection con4 rolls back.
72
 
ROLLBACK;
73
 
 
74
 
# connection con6 rolls back.
75
 
ROLLBACK;
76
 
 
77
 
# The connections 2 and 5 stay open.
78
 
 
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;
85
 
pk      c1
86
 
2       22
87
 
3       77
88
 
4       44
89
 
 
90
 
# connection default
91
 
#
92
 
# Crash server.
93
 
START TRANSACTION;
94
 
INSERT INTO bug_53756 VALUES (666,666);
95
 
SET SESSION debug="+d,crash_commit_before";
96
 
COMMIT;
97
 
ERROR HY000: Lost connection to MySQL server during query
98
 
 
99
 
#
100
 
# disconnect con1, con2, con3, con4, con5, con6.
101
 
#
102
 
# Restart server.
103
 
 
104
 
#
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;
112
 
pk      c1
113
 
2       22
114
 
3       77
115
 
4       44
116
 
 
117
 
# Clean up.
118
 
DROP TABLE bug_53756;