| 1 |
# |
| 2 |
# READ LOCAL / WRITE CONCURRENT locks. |
| 3 |
# This test is separate from the main lock.test |
| 4 |
# because the feature is likely to be unsupported. |
| 5 |
# |
| 6 |
|
| 7 |
--source have_engine.inc |
| 8 |
|
| 9 |
--source include/count_sessions.inc |
| 10 |
|
| 11 |
SET lock_wait_timeout = 1; |
| 12 |
|
| 13 |
--let $create_definition = a $int_col |
| 14 |
--source create_table.inc |
| 15 |
|
| 16 |
LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; |
| 17 |
|
| 18 |
connect (con1,localhost,root,,); |
| 19 |
SET lock_wait_timeout = 1; |
| 20 |
|
| 21 |
# If this statement fails with ER_LOCK_WAIT_TIMEOUT, |
| 22 |
# most likely the engine does not support LOCK .. WRITE CONCURRENT |
| 23 |
LOCK TABLES t1 READ LOCAL; |
| 24 |
if ($mysql_errname) |
| 25 |
{ |
| 26 |
--let $functionality = LOCK .. WRITE CONCURRENT |
| 27 |
--source unexpected_result.inc |
| 28 |
} |
| 29 |
|
| 30 |
UNLOCK TABLES; |
| 31 |
|
| 32 |
connection default; |
| 33 |
UNLOCK TABLES; |
| 34 |
|
| 35 |
connection con1; |
| 36 |
LOCK TABLES t1 READ LOCAL; |
| 37 |
|
| 38 |
connection default; |
| 39 |
LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; |
| 40 |
UNLOCK TABLES; |
| 41 |
|
| 42 |
connection con1; |
| 43 |
UNLOCK TABLES; |
| 44 |
disconnect con1; |
| 45 |
|
| 46 |
connection default; |
| 47 |
DROP TABLE t1; |
| 48 |
|
| 49 |
--source include/wait_until_count_sessions.inc |
| 50 |
|
| 51 |
--source cleanup_engine.inc |
| 52 |
|