From 47f7fc4353f4ee665b703bee6479ad1664db0f48 Mon Sep 17 00:00:00 2001 From: Mayank Prasad Date: Wed, 18 May 2011 19:47:29 +0530 Subject: merge from 5.1 for bug#11764633 --- sql/sql_class.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'sql/sql_class.cc') 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. -- cgit v1.2.1