Skip to content

Commit 4a27ab2

Browse files
author
Nirbhay Choubey
committed
MDEV-10792: Assertion `thd->mdl_context.is_lock_owner ..
.. (MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)' failed in mysql_rm_table_no_locks Reset error flag after temporary table has been successfully dropped.
1 parent ebe0619 commit 4a27ab2

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

mysql-test/r/temp_table.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,5 +538,13 @@ UNLOCK TABLES;
538538
ALTER TABLE t1 RENAME t2, LOCK SHARED;
539539
ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE;
540540
DROP TABLE t1;
541+
#
542+
# MDEV-10792: Assertion `thd->mdl_context.is_lock_owner
543+
# (MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)'
544+
# failed in mysql_rm_table_no_locks
545+
#
546+
CREATE TEMPORARY TABLE t1 (i INT);
547+
DROP TABLE nonexisting_table, t1;
548+
ERROR 42S02: Unknown table 'temp_db.nonexisting_table'
541549
# Cleanup
542550
DROP DATABASE temp_db;

mysql-test/t/temp_table.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,15 @@ ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE;
583583

584584
DROP TABLE t1;
585585

586+
--echo #
587+
--echo # MDEV-10792: Assertion `thd->mdl_context.is_lock_owner
588+
--echo # (MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)'
589+
--echo # failed in mysql_rm_table_no_locks
590+
--echo #
591+
CREATE TEMPORARY TABLE t1 (i INT);
592+
--error ER_BAD_TABLE_ERROR
593+
DROP TABLE nonexisting_table, t1;
594+
586595
--echo # Cleanup
587596
DROP DATABASE temp_db;
588597

sql/sql_table.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,6 +2299,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
22992299
error= 1;
23002300
goto err;
23012301
}
2302+
error= 0;
23022303
table->table= 0;
23032304
}
23042305

0 commit comments

Comments
 (0)