diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-06-07 17:27:40 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-06-07 17:27:40 +0200 |
commit | 4ea99a50be3b42068b4a5d173b2b19633c0c8260 (patch) | |
tree | adbedb50b401496019020cb5fde47d5f40369d25 /mysql-test/r/drop.result | |
parent | 29f9fb7a0a7df0136293aed63cd596bd45ff5b55 (diff) | |
download | mariadb-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.result | 10 |
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; |