| 1 |
# |
| 2 |
# INSERT DELAYED |
| 3 |
# |
| 4 |
|
| 5 |
--source have_engine.inc |
| 6 |
|
| 7 |
if (`SELECT @@log_bin AND @@binlog_format IN ('statement','mixed')`) |
| 8 |
{ |
| 9 |
--source cleanup_engine.inc |
| 10 |
--skip # INSERT DELAYED does not work with binlog format STATEMENT or MIXED |
| 11 |
} |
| 12 |
|
| 13 |
--source include/count_sessions.inc |
| 14 |
|
| 15 |
--disable_warnings |
| 16 |
DROP TABLE IF EXISTS t1; |
| 17 |
--enable_warnings |
| 18 |
|
| 19 |
--let $create_definition = a $int_col, b $char_col |
| 20 |
--source create_table.inc |
| 21 |
INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); |
| 22 |
|
| 23 |
LOCK TABLE t1 READ; |
| 24 |
if ($mysql_errname) |
| 25 |
{ |
| 26 |
--let $functionality = LOCK TABLE .. READ |
| 27 |
--source unexpected_result.inc |
| 28 |
} |
| 29 |
if (!$mysql_errname) |
| 30 |
{ |
| 31 |
--connect (con0,localhost,root,,) |
| 32 |
SET lock_wait_timeout = 1; |
| 33 |
INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); |
| 34 |
if ($mysql_errname) |
| 35 |
{ |
| 36 |
--let $functionality = INSERT DELAYED |
| 37 |
--source unexpected_result.inc |
| 38 |
} |
| 39 |
INSERT DELAYED INTO t1 SET a=4, b='d'; |
| 40 |
# DELAYED is ignored with INSERT .. SELECT |
| 41 |
--let $error_codes = ER_LOCK_WAIT_TIMEOUT |
| 42 |
INSERT DELAYED INTO t1 (a,b) SELECT 5, 'e'; |
| 43 |
--source check_errors.inc |
| 44 |
|
| 45 |
--disconnect con0 |
| 46 |
--connection default |
| 47 |
SELECT a,b FROM t1; |
| 48 |
} |
| 49 |
UNLOCK TABLES; |
| 50 |
FLUSH TABLES; |
| 51 |
SELECT a,b FROM t1; |
| 52 |
|
| 53 |
# Cleanup |
| 54 |
DROP TABLE t1; |
| 55 |
|
| 56 |
let $wait_timeout = 30; |
| 57 |
--source include/wait_until_count_sessions.inc |
| 58 |
|
| 59 |
--source cleanup_engine.inc |
| 60 |
|