Commit 44002a34 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5955 Server crashes in handler::ha_external_lock or assertion...

MDEV-5955 Server crashes in handler::ha_external_lock or assertion `m_lock_type == 2' fails in handler::ha_close on disconnect with a locked temporary table

first unlock locked tables, then close and remove temporary
parent ded448d1
CREATE TEMPORARY TABLE tmp (i INT) ENGINE=InnoDB;
LOCK TABLES tmp AS p WRITE;
#
# MDEV-5955 Server crashes in handler::ha_external_lock or assertion `m_lock_type == 2' fails in handler::ha_close on disconnect with a locked temporary table
#
--source include/have_innodb.inc
--connect (con1,localhost,root,,)
CREATE TEMPORARY TABLE tmp (i INT) ENGINE=InnoDB;
LOCK TABLES tmp AS p WRITE;
--disconnect con1
......@@ -1391,6 +1391,7 @@ void THD::cleanup(void)
#endif
mysql_ha_cleanup(this);
locked_tables_list.unlock_locked_tables(this);
close_temporary_tables(this);
......@@ -1398,8 +1399,6 @@ void THD::cleanup(void)
trans_rollback(this);
xid_cache_delete(&transaction.xid_state);
locked_tables_list.unlock_locked_tables(this);
DBUG_ASSERT(open_tables == NULL);
/*
If the thread was in the middle of an ongoing transaction (rolled
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment