summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2009-12-08 15:56:06 +0100
committerJon Olav Hauglid <jon.hauglid@sun.com>2009-12-08 15:56:06 +0100
commit19ff2445b156a11cbd76e7c741ed05e4eb33dc62 (patch)
treedff4eda1ae5790913638b8b5813d2e84203f4127 /mysql-test/t
parentc0b78cc47a2da2710cdf580ddbb3b31f5f691a23 (diff)
downloadmariadb-git-19ff2445b156a11cbd76e7c741ed05e4eb33dc62.tar.gz
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.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/lock.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 4d610559077..64003c9d861 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -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