summaryrefslogtreecommitdiff
path: root/mysql-test/r/drop.result
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2010-06-07 17:27:40 +0200
committerJon Olav Hauglid <jon.hauglid@sun.com>2010-06-07 17:27:40 +0200
commit4ea99a50be3b42068b4a5d173b2b19633c0c8260 (patch)
treeadbedb50b401496019020cb5fde47d5f40369d25 /mysql-test/r/drop.result
parent29f9fb7a0a7df0136293aed63cd596bd45ff5b55 (diff)
downloadmariadb-git-4ea99a50be3b42068b4a5d173b2b19633c0c8260.tar.gz
Bug #54282 Crash in MDL_context::upgrade_shared_lock_to_exclusive
This crash happened if a table was listed twice in a DROP TABLE statement, and the statement was executed while in LOCK TABLES mode. Since the two elements of table list were identical, they were assigned the same TABLE object. During processing of the first table element, the TABLE instance was destroyed and the second table list element was left with a dangling reference. When this reference was later accessed, the server crashed. Listing the same table twice in DROP TABLES should give an ER_NONUNIQ_TABLE error. However, this did not happen as the check for unique table names was skipped due to the lock type for table list elements being set to TL_IGNORE. Previously TL_UNLOCK was used and the unique check was performed. This bug was a regression introduced by a pre-requisite patch for Bug#51263 "Deadlock between transactional SELECT and ALTER TABLE ... REBUILD PARTITION". The regression only existed in an internal team tree and never in any released code. This patch reverts DROP TABLE (and DROP VIEW) to the old behavior of using TL_UNLOCK locks. Test case added to drop.test.
Diffstat (limited to 'mysql-test/r/drop.result')
-rw-r--r--mysql-test/r/drop.result10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index 17ec2b09a0a..f1712a650b1 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -157,3 +157,13 @@ Error 1051 Unknown table 't1'
# --
# -- End of Bug#37431.
# --
+#
+# Bug#54282 Crash in MDL_context::upgrade_shared_lock_to_exclusive
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+LOCK TABLE t1 WRITE;
+DROP TABLE t1, t1;
+ERROR 42000: Not unique table/alias: 't1'
+UNLOCK TABLES;
+DROP TABLE t1;