diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 236b694726fd86d244cdab1a95269b7a0cceef81..045b56b11c2b65cac9bed6080f4c573befaad891 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -302,6 +302,8 @@ void my_thread_global_end(void)
 #ifndef HAVE_GETHOSTBYNAME_R
   mysql_mutex_destroy(&LOCK_gethostbyname_r);
 #endif
+
+  my_thread_basic_global_init_done= 0;
 }
 
 static my_thread_id thread_id= 0;