diff options
author | Mayank Prasad <mayank.prasad@oracle.com> | 2011-05-18 19:47:29 +0530 |
---|---|---|
committer | Mayank Prasad <mayank.prasad@oracle.com> | 2011-05-18 19:47:29 +0530 |
commit | 359549beabcdafaa847dc41ef2566d414331f79d (patch) | |
tree | 388d5a17eecb020be35658a7d2e81cedc23805ec /sql/sql_class.cc | |
parent | a48bff1d90ca132afeed0eef4a24221070ee965a (diff) | |
download | mariadb-git-359549beabcdafaa847dc41ef2566d414331f79d.tar.gz |
merge from 5.1 for bug#11764633
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 19 |
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. |