summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-06-10 16:19:59 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-06-10 18:39:43 -0400
commit7305be2f7e724e5e62961606794beab199d79045 (patch)
tree403bd132ee82a16946e3208f5d535de6e5945b80 /sql/wsrep_thd.cc
parent547511153fb1f59688752aa5524ae411b5960c92 (diff)
downloadmariadb-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/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index 3835c925745..36768a37973 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -360,13 +360,10 @@ static void wsrep_replication_process(THD *thd)
mysql_cond_broadcast(&COND_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
- TABLE *tmp;
- while ((tmp = thd->temporary_tables))
+ if(thd->has_thd_temporary_tables())
{
- WSREP_WARN("Applier %lld, has temporary tables at exit: %s.%s",
- (longlong) thd->thread_id,
- (tmp->s) ? tmp->s->db.str : "void",
- (tmp->s) ? tmp->s->table_name.str : "void");
+ WSREP_WARN("Applier %lld has temporary tables at exit.",
+ thd->thread_id);
}
wsrep_return_from_bf_mode(thd, &shadow);
DBUG_VOID_RETURN;