169
192
DELETE FROM t1 ORDER BY date ASC LIMIT 1;
195
CREATE TABLE t1 (a int not null,b int not null);
196
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
197
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
198
insert into t1 values (1,1),(2,1),(1,3);
199
insert into t2 values (1,1),(2,2),(3,3);
200
insert into t3 values (1,1),(2,1),(1,3);
201
select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
206
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
207
id select_type table type possible_keys key key_len ref rows Extra
208
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
209
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
210
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 Using index
211
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
172
215
CREATE TABLE t1 (a INT);
173
216
INSERT INTO t1 VALUES (1);
174
217
DELETE FROM t1 ORDER BY x;
196
239
INSERT INTO db2.t1 (a) SELECT * FROM t2;
240
DELETE FROM t1 alias USING t1, t2 alias WHERE t1.a = alias.a;
241
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'alias USING t1, t2 alias WHERE t1.a = alias.a' at line 1
242
DELETE FROM alias USING t1, t2 alias WHERE t1.a = alias.a;
243
DELETE FROM t1, alias USING t1, t2 alias WHERE t1.a = alias.a;
244
DELETE FROM t1, t2 USING t1, t2 alias WHERE t1.a = alias.a;
245
ERROR 42S02: Unknown table 't2' in MULTI DELETE
246
DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
247
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a' at line 1
248
DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
249
DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
250
ERROR 42S02: Unknown table 'alias' in MULTI DELETE
251
DELETE FROM t1 USING t1 WHERE a = 1;
197
252
SELECT * FROM t1;
199
254
DELETE FROM t1 alias USING t1 alias WHERE a = 2;
219
274
CREATE TABLE db2.t2 AS SELECT * FROM db2.t1;
220
275
CREATE TABLE t1 AS SELECT * FROM db2.t2;
221
276
CREATE TABLE t2 AS SELECT * FROM t1;
281
ERROR 3D000: No database selected
282
DELETE a1,a2 FROM db1.t1, db2.t2;
283
ERROR 3D000: No database selected
284
DELETE a1,a2 FROM db1.t1, db2.t2;
285
ERROR 3D000: No database selected
286
DELETE a1,a2 FROM db1.t1 AS a1, db2.t2;
287
ERROR 3D000: No database selected
288
DELETE a1,a2 FROM db1.t1, db2.t2 AS a2;
289
ERROR 3D000: No database selected
290
DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
291
ERROR 3D000: No database selected
292
DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
293
ERROR 3D000: No database selected
294
DELETE FROM a1,a2 USING db1.t1, db2.t2;
295
ERROR 3D000: No database selected
296
DELETE FROM a1,a2 USING db1.t1, db2.t2;
297
ERROR 3D000: No database selected
298
DELETE FROM a1,a2 USING db1.t1 AS a1, db2.t2;
299
ERROR 3D000: No database selected
300
DELETE FROM a1,a2 USING db1.t1, db2.t2 AS a2;
301
ERROR 3D000: No database selected
302
DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
303
ERROR 3D000: No database selected
304
DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
305
ERROR 3D000: No database selected
306
DELETE a1 FROM db1.t1 AS a1, db2.t2 AS a1;
307
ERROR 3D000: No database selected
308
DELETE a1 FROM db1.a1, db2.t2 AS a1;
309
ERROR 3D000: No database selected
310
DELETE a1 FROM a1, db1.t1 AS a1;
311
ERROR 3D000: No database selected
312
DELETE t1 FROM db1.t1, db2.t1 AS a1;
313
ERROR 3D000: No database selected
314
DELETE t1 FROM db1.t1 AS a1, db2.t1 AS a2;
315
ERROR 3D000: No database selected
316
DELETE t1 FROM db1.t1, db2.t1;
317
ERROR 3D000: No database selected
319
DELETE a1,a2 FROM db1.t1, db2.t2;
320
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
321
DELETE a1,a2 FROM db1.t1, db2.t2;
322
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
323
DELETE a1,a2 FROM db1.t1 AS a1, db2.t2;
324
ERROR 42S02: Unknown table 'a2' in MULTI DELETE
325
DELETE a1,a2 FROM db1.t1, db2.t2 AS a2;
326
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
327
DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
328
ERROR 42S02: Table 'db3.t1' doesn't exist
329
DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
330
ERROR 42S02: Table 'db3.t1' doesn't exist
331
DELETE FROM a1,a2 USING db1.t1, db2.t2;
332
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
333
DELETE FROM a1,a2 USING db1.t1, db2.t2;
334
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
335
DELETE FROM a1,a2 USING db1.t1 AS a1, db2.t2;
336
ERROR 42S02: Unknown table 'a2' in MULTI DELETE
337
DELETE FROM a1,a2 USING db1.t1, db2.t2 AS a2;
338
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
339
DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
340
ERROR 42S02: Table 'db3.t1' doesn't exist
341
DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
342
ERROR 42S02: Table 'db3.t1' doesn't exist
343
DELETE a1 FROM db1.t1 AS a1, db2.t2 AS a1;
344
ERROR 42000: Not unique table/alias: 'a1'
345
DELETE a1 FROM db1.a1, db2.t2 AS a1;
346
ERROR 42S02: Table 'db1.a1' doesn't exist
347
DELETE a1 FROM a1, db1.t1 AS a1;
348
ERROR 42000: Not unique table/alias: 'a1'
349
DELETE t1 FROM db1.t1, db2.t1 AS a1;
350
ERROR 42S02: Unknown table 't1' in MULTI DELETE
351
DELETE t1 FROM db1.t1 AS a1, db2.t1 AS a2;
352
ERROR 42S02: Unknown table 't1' in MULTI DELETE
353
DELETE t1 FROM db1.t1, db2.t1;
354
ERROR 42S02: Unknown table 't1' in MULTI DELETE
355
DELETE t1 FROM db1.t2 AS t1, db2.t2 AS t2 WHERE t2.a = 1 AND t1.a = t2.a;
359
DELETE a1, a2 FROM db2.t1 AS a1, t2 AS a2 WHERE a1.a = 2 AND a2.a = 2;
222
363
DROP DATABASE db1;
223
364
DROP DATABASE db2;
224
365
DROP TABLE t1, t2;