diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-06-10 16:19:59 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-06-10 18:39:43 -0400 |
commit | 7305be2f7e724e5e62961606794beab199d79045 (patch) | |
tree | 403bd132ee82a16946e3208f5d535de6e5945b80 /sql/table_cache.cc | |
parent | 547511153fb1f59688752aa5524ae411b5960c92 (diff) | |
download | mariadb-git-7305be2f7e724e5e62961606794beab199d79045.tar.gz |
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.
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r-- | sql/table_cache.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc index c7e95b4df14..bfe51df5de1 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -965,7 +965,7 @@ void tdc_release_share(TABLE_SHARE *share) static void kill_delayed_threads_for_table(TDC_element *element) { - TDC_element::All_share_tables_list::Iterator it(element->all_tables); + All_share_tables_list::Iterator it(element->all_tables); TABLE *tab; mysql_mutex_assert_owner(&element->LOCK_table_share); @@ -1086,7 +1086,7 @@ bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, if (remove_type == TDC_RT_REMOVE_NOT_OWN || remove_type == TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE) { - TDC_element::All_share_tables_list::Iterator it(element->all_tables); + All_share_tables_list::Iterator it(element->all_tables); while ((table= it++)) { my_refs++; |