190
169
DELETE FROM t1 ORDER BY date ASC LIMIT 1;
193
CREATE TABLE t1 (a int not null,b int not null);
194
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
195
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
196
insert into t1 values (1,1),(2,1),(1,3);
197
insert into t2 values (1,1),(2,2),(3,3);
198
insert into t3 values (1,1),(2,1),(1,3);
199
select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
204
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
205
id select_type table type possible_keys key key_len ref rows Extra
206
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
207
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
208
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 Using index
209
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
213
172
CREATE TABLE t1 (a INT);
214
173
INSERT INTO t1 VALUES (1);
215
174
DELETE FROM t1 ORDER BY x;
237
196
INSERT INTO db2.t1 (a) SELECT * FROM t2;
238
DELETE FROM t1 alias USING t1, t2 alias WHERE t1.a = alias.a;
239
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
240
DELETE FROM alias USING t1, t2 alias WHERE t1.a = alias.a;
241
DELETE FROM t1, alias USING t1, t2 alias WHERE t1.a = alias.a;
242
DELETE FROM t1, t2 USING t1, t2 alias WHERE t1.a = alias.a;
243
ERROR 42S02: Unknown table 't2' in MULTI DELETE
244
DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
245
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
246
DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
247
DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
248
ERROR 42S02: Unknown table 'alias' in MULTI DELETE
249
DELETE FROM t1 USING t1 WHERE a = 1;
250
197
SELECT * FROM t1;
252
199
DELETE FROM t1 alias USING t1 alias WHERE a = 2;
272
219
CREATE TABLE db2.t2 AS SELECT * FROM db2.t1;
273
220
CREATE TABLE t1 AS SELECT * FROM db2.t2;
274
221
CREATE TABLE t2 AS SELECT * FROM t1;
279
ERROR 3D000: No database selected
280
DELETE a1,a2 FROM db1.t1, db2.t2;
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 AS a1, db2.t2;
285
ERROR 3D000: No database selected
286
DELETE a1,a2 FROM db1.t1, db2.t2 AS a2;
287
ERROR 3D000: No database selected
288
DELETE a1,a2 FROM db3.t1 AS a1, db4.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 FROM a1,a2 USING db1.t1, db2.t2;
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 AS a1, db2.t2;
297
ERROR 3D000: No database selected
298
DELETE FROM a1,a2 USING db1.t1, db2.t2 AS a2;
299
ERROR 3D000: No database selected
300
DELETE FROM a1,a2 USING db3.t1 AS a1, db4.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 a1 FROM db1.t1 AS a1, db2.t2 AS a1;
305
ERROR 3D000: No database selected
306
DELETE a1 FROM db1.a1, db2.t2 AS a1;
307
ERROR 3D000: No database selected
308
DELETE a1 FROM a1, db1.t1 AS a1;
309
ERROR 3D000: No database selected
310
DELETE t1 FROM db1.t1, db2.t1 AS a1;
311
ERROR 3D000: No database selected
312
DELETE t1 FROM db1.t1 AS a1, db2.t1 AS a2;
313
ERROR 3D000: No database selected
314
DELETE t1 FROM db1.t1, db2.t1;
315
ERROR 3D000: No database selected
317
DELETE a1,a2 FROM db1.t1, db2.t2;
318
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
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 AS a1, db2.t2;
322
ERROR 42S02: Unknown table 'a2' in MULTI DELETE
323
DELETE a1,a2 FROM db1.t1, db2.t2 AS a2;
324
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
325
DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
326
ERROR 42S02: Table 'db3.t1' doesn't exist
327
DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
328
ERROR 42S02: Table 'db3.t1' doesn't exist
329
DELETE FROM a1,a2 USING db1.t1, db2.t2;
330
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
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 AS a1, db2.t2;
334
ERROR 42S02: Unknown table 'a2' in MULTI DELETE
335
DELETE FROM a1,a2 USING db1.t1, db2.t2 AS a2;
336
ERROR 42S02: Unknown table 'a1' in MULTI DELETE
337
DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
338
ERROR 42S02: Table 'db3.t1' doesn't exist
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 a1 FROM db1.t1 AS a1, db2.t2 AS a1;
342
ERROR 42000: Not unique table/alias: 'a1'
343
DELETE a1 FROM db1.a1, db2.t2 AS a1;
344
ERROR 42S02: Table 'db1.a1' doesn't exist
345
DELETE a1 FROM a1, db1.t1 AS a1;
346
ERROR 42000: Not unique table/alias: 'a1'
347
DELETE t1 FROM db1.t1, db2.t1 AS a1;
348
ERROR 42S02: Unknown table 't1' in MULTI DELETE
349
DELETE t1 FROM db1.t1 AS a1, db2.t1 AS a2;
350
ERROR 42S02: Unknown table 't1' in MULTI DELETE
351
DELETE t1 FROM db1.t1, db2.t1;
352
ERROR 42S02: Unknown table 't1' in MULTI DELETE
353
DELETE t1 FROM db1.t2 AS t1, db2.t2 AS t2 WHERE t2.a = 1 AND t1.a = t2.a;
357
DELETE a1, a2 FROM db2.t1 AS a1, t2 AS a2 WHERE a1.a = 2 AND a2.a = 2;