| 1 |
# |
| 2 |
# DELETE QUICK syntax. |
| 3 |
# For now we only check that the keyword is accepted, |
| 4 |
# without actually checking whether the feature works. |
| 5 |
# |
| 6 |
|
| 7 |
--source have_engine.inc |
| 8 |
--source have_default_index.inc |
| 9 |
|
| 10 |
--disable_warnings |
| 11 |
DROP TABLE IF EXISTS t1,t2; |
| 12 |
--enable_warnings |
| 13 |
|
| 14 |
--let $create_definition = a $int_indexed_col, $default_index (a), b $char_col |
| 15 |
--source create_table.inc |
| 16 |
if ($mysql_errname) |
| 17 |
{ |
| 18 |
--source unexpected_result.inc |
| 19 |
} |
| 20 |
if (!$mysql_errname) |
| 21 |
{ |
| 22 |
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); |
| 23 |
|
| 24 |
DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo'; |
| 25 |
if ($mysql_errname) |
| 26 |
{ |
| 27 |
--let $functionality = DELETE or DELETE QUICK |
| 28 |
--source unexpected_result.inc |
| 29 |
} |
| 30 |
if (!$mysql_errname) |
| 31 |
{ |
| 32 |
--sorted_result |
| 33 |
SELECT a,b FROM t1; |
| 34 |
|
| 35 |
--let $create_definition = c $char_col, d $int_col |
| 36 |
--let $table_name = t2 |
| 37 |
--source create_table.inc |
| 38 |
INSERT INTO t2 (c,d) SELECT b, a FROM t1; |
| 39 |
--sorted_result |
| 40 |
SELECT c,d FROM t2; |
| 41 |
|
| 42 |
DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; |
| 43 |
--sorted_result |
| 44 |
SELECT a,b FROM t1; |
| 45 |
--sorted_result |
| 46 |
SELECT c,d FROM t2; |
| 47 |
DROP TABLE t2; |
| 48 |
} |
| 49 |
DROP TABLE t1; |
| 50 |
} |
| 51 |
|
| 52 |
# Cleanup |
| 53 |
|
| 54 |
--source cleanup_engine.inc |
| 55 |
|