summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 420ec67f0c5..937d1e52656 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -202,6 +202,8 @@ void udf_init()
new_thd->version--; // Force close to free memory
close_thread_tables(new_thd);
delete new_thd;
+ /* Remember that we don't have a THD */
+ my_pthread_setspecific_ptr(THR_THD, 0);
DBUG_VOID_RETURN;
}