From bebe24b03b859d3d01b0bd56356047531a26fac4 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 26 Dec 2017 14:38:45 +0400 Subject: MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in Locked_tables_list::unlock_locked_tables Similarly to regular DROP TABLE, don't leave locked tables mode if CREATE OR REPLACE dropped temporary table but failed to cerate new one. The problem is that there's no track of which temporary table was "locked" by LOCK TABLES. --- sql/sql_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 5d20ad3967c..2302026b18b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5087,7 +5087,7 @@ err: /* Write log if no error or if we already deleted a table */ if (!result || thd->log_current_statement) { - if (result && create_info->table_was_deleted) + if (result && create_info->table_was_deleted && pos_in_locked_tables) { /* Possible locked table was dropped. We should remove meta data locks -- cgit v1.2.1