1
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
2
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
3
SET @runtime = <intended_runtime>;
4
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
5
DROP TABLE IF EXISTS t1;
6
# Subtest 1A (one connection, no PREPARE/EXECUTE)
8
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
10
# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
11
# default: DROP TABLE t1
12
# Subtest 1B (one connection, use PREPARE/EXECUTE)
14
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
16
# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
17
# default: DROP TABLE t1
18
# Subtest 1C (two connections, no PREPARE/EXECUTE)
20
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
22
# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
24
# Subtest 1D (two connections, use PREPARE/EXECUTE)
26
# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
28
# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
30
# Subtest 2A (one connection, no PREPARE/EXECUTE)
32
# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
33
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
34
# default: DROP TABLE t1
35
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
36
# Subtest 2B (one connection, use PREPARE/EXECUTE)
38
# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
39
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
40
# default: DROP TABLE t1
41
# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
42
# Subtest 2C (two connections, no PREPARE/EXECUTE)
44
# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
45
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
46
# default: DROP TABLE t1
47
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
48
# Subtest 2D (two connections, use PREPARE/EXECUTE)
50
# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
51
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
52
# default: DROP TABLE t1
53
# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
54
# Subtest 3A (one connection, no PREPARE/EXECUTE)
56
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM
57
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
58
# default: DROP TABLE t1
59
# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
60
# Subtest 3B (one connection, use PREPARE/EXECUTE)
62
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM
63
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
64
# default: DROP TABLE t1
65
# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
66
# Subtest 3C (two connections, no PREPARE/EXECUTE)
68
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM
69
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
70
# default: DROP TABLE t1
71
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
72
# Subtest 3D (two connections, use PREPARE/EXECUTE)
74
# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM
75
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
76
# default: DROP TABLE t1
77
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
78
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM;
80
CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
82
# Subtest 4A (one connection, no PREPARE/EXECUTE)
84
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
85
# default: SHOW CREATE TABLE t1
86
# default: DROP TABLE t1
87
# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
88
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
89
# default: SHOW CREATE TABLE t1
90
# default: DROP TABLE t1
91
# Subtest 4B (one connection, use PREPARE/EXECUTE)
93
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
94
# default: SHOW CREATE TABLE t1
95
# default: DROP TABLE t1
96
# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
97
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
98
# default: SHOW CREATE TABLE t1
99
# default: DROP TABLE t1
100
# Subtest 4C (two connections, no PREPARE/EXECUTE)
102
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
103
# con2: SHOW CREATE TABLE t1
104
# default: DROP TABLE t1
105
# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
106
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
107
# con2: SHOW CREATE TABLE t1
108
# default: DROP TABLE t1
109
# Subtest 4D (two connections, use PREPARE/EXECUTE)
111
# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
112
# con2: SHOW CREATE TABLE t1
113
# default: DROP TABLE t1
114
# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
115
# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
116
# con2: SHOW CREATE TABLE t1
117
# default: DROP TABLE t1
118
# Subtest 5A (one connection, no PREPARE/EXECUTE)
120
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
121
# default: INSERT INTO t1 SET f2 = 9
122
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
123
# default: DROP TABLE t1
124
# Subtest 5B (one connection, use PREPARE/EXECUTE)
126
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
127
# default: INSERT INTO t1 SET f2 = 9
128
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
129
# default: DROP TABLE t1
130
# Subtest 5C (two connections, no PREPARE/EXECUTE)
132
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
133
# con2: INSERT INTO t1 SET f2 = 9
134
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
135
# con2: DROP TABLE t1
136
# Subtest 5D (two connections, use PREPARE/EXECUTE)
138
# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
139
# con2: INSERT INTO t1 SET f2 = 9
140
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
141
# con2: DROP TABLE t1
142
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM;
143
# Subtest 6A (one connection, no PREPARE/EXECUTE)
145
# default: CREATE INDEX IDX1 ON t1 (f2)
146
# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
147
# default: DROP INDEX IDX1 ON t1
148
# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
149
# default: CREATE INDEX IDX1 ON t1 (f2)
150
# default: DROP INDEX IDX1 ON t1
151
# Subtest 6B (one connection, use PREPARE/EXECUTE)
153
# default: CREATE INDEX IDX1 ON t1 (f2)
154
# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
155
# default: DROP INDEX IDX1 ON t1
156
# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
157
# default: CREATE INDEX IDX1 ON t1 (f2)
158
# default: DROP INDEX IDX1 ON t1
159
# Subtest 6C (two connections, no PREPARE/EXECUTE)
161
# default: CREATE INDEX IDX1 ON t1 (f2)
162
# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
163
# default: DROP INDEX IDX1 ON t1
164
# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
165
# default: CREATE INDEX IDX1 ON t1 (f2)
166
# con2: DROP INDEX IDX1 ON t1
167
# Subtest 6D (two connections, use PREPARE/EXECUTE)
169
# default: CREATE INDEX IDX1 ON t1 (f2)
170
# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
171
# default: DROP INDEX IDX1 ON t1
172
# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
173
# default: CREATE INDEX IDX1 ON t1 (f2)
174
# con2: DROP INDEX IDX1 ON t1
176
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MyISAM;
177
INSERT INTO t1 VALUES(0,1);
178
# Subtest 7A (one connection, no PREPARE/EXECUTE)
180
# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
181
# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
182
# default: DROP INDEX IDX1 ON t1
183
# default: INSERT INTO t1 VALUES(1,1)
184
# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
185
# default: DELETE FROM t1 WHERE f1 = 1
186
# Subtest 7B (one connection, use PREPARE/EXECUTE)
188
# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
189
# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
190
# default: DROP INDEX IDX1 ON t1
191
# default: INSERT INTO t1 VALUES(1,1)
192
# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
193
# default: DELETE FROM t1 WHERE f1 = 1
194
# Subtest 7C (two connections, no PREPARE/EXECUTE)
196
# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
197
# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
198
# con2: DROP INDEX IDX1 ON t1
199
# default: INSERT INTO t1 VALUES(1,1)
200
# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
201
# con2: DELETE FROM t1 WHERE f1 = 1
202
# Subtest 7D (two connections, use PREPARE/EXECUTE)
204
# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
205
# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
206
# con2: DROP INDEX IDX1 ON t1
207
# default: INSERT INTO t1 VALUES(1,1)
208
# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
209
# con2: DELETE FROM t1 WHERE f1 = 1
211
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM;
212
INSERT INTO t1 VALUES(1,1);
213
CREATE INDEX IDX ON t1 (f2);
214
DROP INDEX IDX ON t1;
215
CREATE UNIQUE INDEX IDX ON t1 (f2);
216
DROP INDEX IDX ON t1;
217
# Subtest 8A (one connection, no PREPARE/EXECUTE)
219
# default: CREATE INDEX IDX ON t1 (f2)
220
# default: SHOW CREATE TABLE t1
221
# default: DROP INDEX IDX ON t1
222
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
223
# default: SHOW CREATE TABLE t1
224
# default: DROP INDEX IDX ON t1
225
# Subtest 8B (one connection, use PREPARE/EXECUTE)
227
# default: CREATE INDEX IDX ON t1 (f2)
228
# default: SHOW CREATE TABLE t1
229
# default: DROP INDEX IDX ON t1
230
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
231
# default: SHOW CREATE TABLE t1
232
# default: DROP INDEX IDX ON t1
233
# Subtest 8C (two connections, no PREPARE/EXECUTE)
235
# default: CREATE INDEX IDX ON t1 (f2)
236
# con2: SHOW CREATE TABLE t1
237
# default: DROP INDEX IDX ON t1
238
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
239
# con2: SHOW CREATE TABLE t1
240
# default: DROP INDEX IDX ON t1
241
# Subtest 8D (two connections, use PREPARE/EXECUTE)
243
# default: CREATE INDEX IDX ON t1 (f2)
244
# con2: SHOW CREATE TABLE t1
245
# default: DROP INDEX IDX ON t1
246
# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
247
# con2: SHOW CREATE TABLE t1
248
# default: DROP INDEX IDX ON t1
250
DEALLOCATE PREPARE stmt_start;
251
DEALLOCATE PREPARE stmt_break;