mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Backport of revno: 2617.68.9
Bug #43272 HANDLER SQL command does not work under LOCK TABLES HANDLER commands are now explicitly disallowed in LOCK TABLES mode. Before, HANDLER OPEN gave the misleading error message: "Table x was not locked with LOCK TABLES". This patch changes HANDLER OPEN/READ/CLOSE to give ER_LOCK_OR_ACTIVE_TRANSACTION "Can't execute the given command because you have active locked tables or an active transaction" in LOCK TABLES mode. Test case added to lock.test.
This commit is contained in:
@@ -319,6 +319,21 @@ alter table t1 add column j int;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #43272 HANDLER SQL command does not work under LOCK TABLES
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
LOCK TABLE t1 WRITE;
|
||||
# HANDLER commands are not allowed in LOCK TABLES mode
|
||||
HANDLER t1 OPEN;
|
||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
HANDLER t1 READ FIRST;
|
||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
HANDLER t1 CLOSE;
|
||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#45066 FLUSH TABLES WITH READ LOCK deadlocks against
|
||||
# LOCK TABLE
|
||||
#
|
||||
|
||||
@@ -385,6 +385,30 @@ alter table t1 add column j int;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #43272 HANDLER SQL command does not work under LOCK TABLES
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
LOCK TABLE t1 WRITE;
|
||||
|
||||
--echo # HANDLER commands are not allowed in LOCK TABLES mode
|
||||
--error ER_LOCK_OR_ACTIVE_TRANSACTION
|
||||
HANDLER t1 OPEN;
|
||||
--error ER_LOCK_OR_ACTIVE_TRANSACTION
|
||||
HANDLER t1 READ FIRST;
|
||||
--error ER_LOCK_OR_ACTIVE_TRANSACTION
|
||||
HANDLER t1 CLOSE;
|
||||
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#45066 FLUSH TABLES WITH READ LOCK deadlocks against
|
||||
--echo # LOCK TABLE
|
||||
|
||||
Reference in New Issue
Block a user