summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-08-24 19:30:32 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-08-24 19:30:32 -0400
commitc309e99ff9b48c1736ff468e72153048c4b56561 (patch)
tree1fb9e8831597007bcfa9e7ea2b2aadb717b962cd /sql/sql_class.cc
parent8b09db8bfb81f1e7695cfcfa6ce2bec45247171f (diff)
parent5bbe929d706e26cb3f9b291da6009526a17b1545 (diff)
downloadmariadb-git-c309e99ff9b48c1736ff468e72153048c4b56561.tar.gz
Merge branch '10.0' into 10.0-galera
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 76f8b98c55e..10779aebbda 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -6809,10 +6809,18 @@ void THD::rgi_lock_temporary_tables()
temporary_tables= rgi_slave->rli->save_temporary_tables;
}
-void THD::rgi_unlock_temporary_tables()
+void THD::rgi_unlock_temporary_tables(bool clear)
{
rgi_slave->rli->save_temporary_tables= temporary_tables;
mysql_mutex_unlock(&rgi_slave->rli->data_lock);
+ if (clear)
+ {
+ /*
+ Temporary tables are shared with other by sql execution threads.
+ As a safety messure, clear the pointer to the common area.
+ */
+ temporary_tables= 0;
+ }
}
bool THD::rgi_have_temporary_tables()