~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/tests/t/innodb_bug53756.test

  • Committer: patrick crews
  • Date: 2011-01-23 20:31:58 UTC
  • mto: (2119.2.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2121.
  • Revision ID: gleebix@gmail.com-20110123203158-edw17l852lfcowpm
Removed innodb_bug53756.test as it was using MTR2 functionality we don't have.  Tweaks to error handling for certain cases (non-existent suite)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This is the test case for bug #53756. Alter table operation could
2
 
# leave a deleted record for the temp table (later renamed to the altered
3
 
# table) in the SYS_TABLES secondary index, we should ignore this row and
4
 
# find the first non-deleted row for the specified table_id when load table
5
 
# metadata in the function dict_load_table_on_id() during crash recovery.
6
 
 
7
 
 
8
 
#
9
 
# This test case needs to crash the server. Needs a debug server.
10
 
--source include/have_debug.inc
11
 
#
12
 
# Don't test this under valgrind, memory leaks will occur.
13
 
--source include/not_valgrind.inc
14
 
#
15
 
# This test case needs InnoDB.
16
 
--source include/have_innodb.inc
17
 
 
18
 
#
19
 
# Precautionary clean up.
20
 
#
21
 
--disable_warnings
22
 
DROP TABLE IF EXISTS bug_53756 ;
23
 
--enable_warnings
24
 
 
25
 
#
26
 
# Create test data.
27
 
#
28
 
CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
29
 
ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
30
 
INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
31
 
 
32
 
--echo
33
 
--echo # Select a less restrictive isolation level.
34
 
# Don't use user variables. They won't survive server crash.
35
 
--let $global_isolation= `SELECT @@global.tx_isolation`
36
 
--let $session_isolation= `SELECT @@session.tx_isolation`
37
 
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
38
 
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
39
 
COMMIT;
40
 
 
41
 
--echo
42
 
--echo # Start a transaction in the default connection for isolation.
43
 
START TRANSACTION;
44
 
SELECT @@tx_isolation;
45
 
SELECT * FROM bug_53756;
46
 
 
47
 
--echo
48
 
--echo # connection con1 deletes row 1
49
 
--connect (con1,localhost,root,,)
50
 
START TRANSACTION;
51
 
SELECT @@tx_isolation;
52
 
DELETE FROM bug_53756 WHERE pk=1;
53
 
 
54
 
--echo
55
 
--echo # connection con2 deletes row 2
56
 
--connect (con2,localhost,root,,)
57
 
START TRANSACTION;
58
 
SELECT @@tx_isolation;
59
 
DELETE FROM bug_53756 WHERE pk=2;
60
 
 
61
 
--echo
62
 
--echo # connection con3 updates row 3
63
 
--connect (con3,localhost,root,,)
64
 
START TRANSACTION;
65
 
SELECT @@tx_isolation;
66
 
UPDATE bug_53756 SET c1=77 WHERE pk=3;
67
 
 
68
 
--echo
69
 
--echo # connection con4 updates row 4
70
 
--connect (con4,localhost,root,,)
71
 
START TRANSACTION;
72
 
SELECT @@tx_isolation;
73
 
UPDATE bug_53756 SET c1=88 WHERE pk=4;
74
 
 
75
 
--echo
76
 
--echo # connection con5 inserts row 5
77
 
--connect (con5,localhost,root,,)
78
 
START TRANSACTION;
79
 
SELECT @@tx_isolation;
80
 
INSERT INTO bug_53756 VALUES(5, 55);
81
 
 
82
 
--echo
83
 
--echo # connection con6 inserts row 6
84
 
--connect (con6,localhost,root,,)
85
 
START TRANSACTION;
86
 
SELECT @@tx_isolation;
87
 
INSERT INTO bug_53756 VALUES(6, 66);
88
 
 
89
 
--echo
90
 
--echo # connection con1 commits.
91
 
--connection con1
92
 
COMMIT;
93
 
 
94
 
--echo
95
 
--echo # connection con3 commits.
96
 
--connection con3
97
 
COMMIT;
98
 
 
99
 
--echo
100
 
--echo # connection con4 rolls back.
101
 
--connection con4
102
 
ROLLBACK;
103
 
 
104
 
--echo
105
 
--echo # connection con6 rolls back.
106
 
--connection con6
107
 
ROLLBACK;
108
 
 
109
 
--echo
110
 
--echo # The connections 2 and 5 stay open.
111
 
 
112
 
--echo
113
 
--echo # connection default selects resulting data.
114
 
--echo # Delete of row 1 was committed.
115
 
--echo # Update of row 3 was committed.
116
 
--echo # Due to isolation level read committed, these should be included.
117
 
--echo # All other changes should not be included.
118
 
--connection default
119
 
SELECT * FROM bug_53756;
120
 
 
121
 
--echo
122
 
--echo # connection default
123
 
--connection default
124
 
--echo #
125
 
--echo # Crash server.
126
 
#
127
 
# Write file to make mysql-test-run.pl expect the "crash", but don't start
128
 
# it until it's told to
129
 
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
130
 
#
131
 
START TRANSACTION;
132
 
INSERT INTO bug_53756 VALUES (666,666);
133
 
#
134
 
# Request a crash on next execution of commit.
135
 
SET SESSION debug="+d,crash_commit_before";
136
 
#
137
 
# Execute the statement that causes the crash.
138
 
--error 2013
139
 
COMMIT;
140
 
--echo
141
 
--echo #
142
 
--echo # disconnect con1, con2, con3, con4, con5, con6.
143
 
--disconnect con1
144
 
--disconnect con2
145
 
--disconnect con3
146
 
--disconnect con4
147
 
--disconnect con5
148
 
--disconnect con6
149
 
--echo #
150
 
--echo # Restart server.
151
 
#
152
 
# Write file to make mysql-test-run.pl start up the server again
153
 
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
154
 
#
155
 
# Turn on reconnect
156
 
--enable_reconnect
157
 
#
158
 
# Call script that will poll the server waiting for it to be back online again
159
 
--source include/wait_until_connected_again.inc
160
 
#
161
 
# Turn off reconnect again
162
 
--disable_reconnect
163
 
--echo
164
 
 
165
 
--echo #
166
 
--echo # Select recovered data.
167
 
--echo # Delete of row 1 was committed.
168
 
--echo # Update of row 3 was committed.
169
 
--echo # These should be included.
170
 
--echo # All other changes should not be included.
171
 
--echo # Delete of row 2 and insert of row 5 should be rolled back
172
 
SELECT * FROM bug_53756;
173
 
 
174
 
--echo
175
 
--echo # Clean up.
176
 
DROP TABLE bug_53756;
177
 
 
178
 
--disable_query_log
179
 
eval SET GLOBAL tx_isolation= '$global_isolation';
180
 
eval SET SESSION tx_isolation= '$session_isolation';
181
 
--enable_query_log
182