~drizzle-trunk/drizzle/development

1 by brian
clean slate
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)
7
#    connection  action
8
#    default:    CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
9
ENGINE = NDB
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)
13
#    connection  action
14
#    default:    CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
15
ENGINE = NDB
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)
19
#    connection  action
20
#    default:    CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
21
ENGINE = NDB
22
#    con2:       INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
23
#    con2:       DROP TABLE t1
24
# Subtest 1D (two connections, use PREPARE/EXECUTE)
25
#    connection  action
26
#    default:    CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
27
ENGINE = NDB
28
#    con2:       INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
29
#    con2:       DROP TABLE t1
30
# Subtest 2A (one connection, no PREPARE/EXECUTE)
31
#    connection  action
32
#    default:    CREATE TABLE t1 ENGINE = NDB 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)
37
#    connection  action
38
#    default:    CREATE TABLE t1 ENGINE = NDB 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)
43
#    connection  action
44
#    default:    CREATE TABLE t1 ENGINE = NDB 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)
49
#    connection  action
50
#    default:    CREATE TABLE t1 ENGINE = NDB 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)
55
#    connection  action
56
#    default:    CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
57
#    default:    CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (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)
61
#    connection  action
62
#    default:    CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
63
#    default:    CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (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)
67
#    connection  action
68
#    default:    CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
69
#    con2:       CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (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)
73
#    connection  action
74
#    default:    CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB
75
#    con2:       CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=NDB (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=NDB;
79
DROP TABLE t1;
80
CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB;
81
DROP TABLE t1;
82
# Subtest 4A (one connection, no PREPARE/EXECUTE)
83
#    connection  action
84
#    default:    CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
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=NDB
89
#    default:    SHOW CREATE TABLE t1
90
#    default:    DROP TABLE t1
91
# Subtest 4B (one connection, use PREPARE/EXECUTE)
92
#    connection  action
93
#    default:    CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
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=NDB
98
#    default:    SHOW CREATE TABLE t1
99
#    default:    DROP TABLE t1
100
# Subtest 4C (two connections, no PREPARE/EXECUTE)
101
#    connection  action
102
#    default:    CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
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=NDB
107
#    con2:       SHOW CREATE TABLE t1
108
#    default:    DROP TABLE t1
109
# Subtest 4D (two connections, use PREPARE/EXECUTE)
110
#    connection  action
111
#    default:    CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
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=NDB
116
#    con2:       SHOW CREATE TABLE t1
117
#    default:    DROP TABLE t1
118
# Subtest 5A (one connection, no PREPARE/EXECUTE)
119
#    connection  action
120
#    default:    CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
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)
125
#    connection  action
126
#    default:    CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
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)
131
#    connection  action
132
#    default:    CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
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)
137
#    connection  action
138
#    default:    CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
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=NDB;
143
# Subtest 6A (one connection, no PREPARE/EXECUTE)
144
#    connection  action
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)
152
#    connection  action
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)
160
#    connection  action
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)
168
#    connection  action
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
175
DROP TABLE t1;
176
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
177
INSERT INTO t1 VALUES(1,1);
178
CREATE INDEX IDX ON t1 (f2);
179
DROP INDEX IDX ON t1;
180
CREATE UNIQUE INDEX IDX ON t1 (f2);
181
DROP INDEX IDX ON t1;
182
# Subtest 8A (one connection, no PREPARE/EXECUTE)
183
#    connection  action
184
#    default:    CREATE INDEX IDX ON t1 (f2)
185
#    default:    SHOW CREATE TABLE t1
186
#    default:    DROP INDEX IDX ON t1
187
#    default:    CREATE UNIQUE INDEX IDX ON t1 (f2)
188
#    default:    SHOW CREATE TABLE t1
189
#    default:    DROP INDEX IDX ON t1
190
# Subtest 8B (one connection, use PREPARE/EXECUTE)
191
#    connection  action
192
#    default:    CREATE INDEX IDX ON t1 (f2)
193
#    default:    SHOW CREATE TABLE t1
194
#    default:    DROP INDEX IDX ON t1
195
#    default:    CREATE UNIQUE INDEX IDX ON t1 (f2)
196
#    default:    SHOW CREATE TABLE t1
197
#    default:    DROP INDEX IDX ON t1
198
# Subtest 8C (two connections, no PREPARE/EXECUTE)
199
#    connection  action
200
#    default:    CREATE INDEX IDX ON t1 (f2)
201
#    con2:       SHOW CREATE TABLE t1
202
#    default:    DROP INDEX IDX ON t1
203
#    default:    CREATE UNIQUE INDEX IDX ON t1 (f2)
204
#    con2:       SHOW CREATE TABLE t1
205
#    default:    DROP INDEX IDX ON t1
206
# Subtest 8D (two connections, use PREPARE/EXECUTE)
207
#    connection  action
208
#    default:    CREATE INDEX IDX ON t1 (f2)
209
#    con2:       SHOW CREATE TABLE t1
210
#    default:    DROP INDEX IDX ON t1
211
#    default:    CREATE UNIQUE INDEX IDX ON t1 (f2)
212
#    con2:       SHOW CREATE TABLE t1
213
#    default:    DROP INDEX IDX ON t1
214
DROP TABLE t1;
215
DEALLOCATE PREPARE stmt_start;
216
DEALLOCATE PREPARE stmt_break;