From bad2f1569da57c4a81cc84ec2f4a79924df9c8d6 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 12 Sep 2018 16:36:45 +0400 Subject: MDEV-17167 - InnoDB: Failing assertion: table->get_ref_count() == 0 upon truncating a temporary table TRUNCATE expects only one TABLE instance (which is used by TRUNCATE itself) to be open. However this requirement wasn't enforced after "MDEV-5535: Cannot reopen temporary table". Fixed by closing unused table instances before performing TRUNCATE. --- sql/sql_class.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 97c5bfa3c12..acd48b07900 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -4628,6 +4628,7 @@ public: TMP_TABLE_SHARE* save_tmp_table_share(TABLE *table); void restore_tmp_table_share(TMP_TABLE_SHARE *share); + void close_unused_temporary_table_instances(const TABLE_LIST *tl); private: /* Whether a lock has been acquired? */ -- cgit v1.2.1