From 7305be2f7e724e5e62961606794beab199d79045 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 10 Jun 2016 16:19:59 -0400 Subject: MDEV-5535: Cannot reopen temporary table mysqld maintains a list of TABLE objects for all temporary tables created within a session in THD. Here each table is represented by a TABLE object. A query referencing a particular temporary table for more than once, however, failed with ER_CANT_REOPEN_TABLE error because a TABLE_SHARE was allocate together with the TABLE, so temporary tables always had only one TABLE per TABLE_SHARE. This patch lift this restriction by separating TABLE and TABLE_SHARE objects and storing TABLE_SHAREs for temporary tables in a list in THD, and TABLEs in a list within their respective TABLE_SHAREs. --- sql/sql_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_test.cc') diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 50d51dcc8cc..76586a9fbba 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -82,7 +82,7 @@ static my_bool print_cached_tables_callback(TDC_element *element, TABLE *entry; mysql_mutex_lock(&element->LOCK_table_share); - TDC_element::All_share_tables_list::Iterator it(element->all_tables); + All_share_tables_list::Iterator it(element->all_tables); while ((entry= it++)) { THD *in_use= entry->in_use; -- cgit v1.2.1