summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMayank Prasad <mayank.prasad@oracle.com>2011-05-18 19:47:29 +0530
committerMayank Prasad <mayank.prasad@oracle.com>2011-05-18 19:47:29 +0530
commit47f7fc4353f4ee665b703bee6479ad1664db0f48 (patch)
tree388d5a17eecb020be35658a7d2e81cedc23805ec /sql/sql_class.cc
parentb7ed314fab7104230a3f5559e2c030a12a24eef7 (diff)
downloadmariadb-git-47f7fc4353f4ee665b703bee6479ad1664db0f48.tar.gz
merge from 5.1 for bug#11764633
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 4af038bb4e0..733d46148c5 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1354,6 +1354,25 @@ bool THD::store_globals()
return 0;
}
+/*
+ Remove the thread specific info (THD and mem_root pointer) stored during
+ store_global call for this thread.
+*/
+bool THD::restore_globals()
+{
+ /*
+ Assert that thread_stack is initialized: it's necessary to be able
+ to track stack overrun.
+ */
+ DBUG_ASSERT(thread_stack);
+
+ /* Undocking the thread specific data. */
+ my_pthread_setspecific_ptr(THR_THD, NULL);
+ my_pthread_setspecific_ptr(THR_MALLOC, NULL);
+
+ return 0;
+}
+
/*
Cleanup after query.