diff options
author | Guilhem Bichot <guilhem.bichot@oracle.com> | 2011-05-21 10:43:54 +0200 |
---|---|---|
committer | Guilhem Bichot <guilhem.bichot@oracle.com> | 2011-05-21 10:43:54 +0200 |
commit | 06115abdf96e381c251e8eff2a64a620b94a7431 (patch) | |
tree | d5951b181993715df32dcab3394f692896eedf51 /sql/sql_class.cc | |
parent | 12c42b980aa94105a9108d4f58c5dc75d96ec824 (diff) | |
parent | 733893ba502cfd1378ece9c1e0dbae98bf7ba9df (diff) | |
download | mariadb-git-06115abdf96e381c251e8eff2a64a620b94a7431.tar.gz |
merge from latest 5.1
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 100ccc46371..5fc5df300f5 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1195,6 +1195,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. |