summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 19bbf08353a..14ad2e057dd 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -517,6 +517,12 @@ void THD::awake(THD::killed_state state_to_set)
bool THD::store_globals()
{
+ /*
+ Assert that thread_stack is initialized: it's necessary to be able
+ to track stack overrun.
+ */
+ DBUG_ASSERT(this->thread_stack);
+
if (my_pthread_setspecific_ptr(THR_THD, this) ||
my_pthread_setspecific_ptr(THR_MALLOC, &mem_root))
return 1;