From 1ab711bebbd961b8882acf0ac0fbdd1971d54597 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 7 Feb 2016 15:23:08 +0200 Subject: [PATCH] Corrected freeing of thd when running with wsrep and thread pool This is needed because of the new code where THD creation was moved to the new thread --- sql/wsrep_mysqld.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 0c527bf3708..9af63e70761 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1847,14 +1847,15 @@ pthread_handler_t start_wsrep_THD(void *arg) // at server shutdown } - my_thread_end(); if (thread_handling > SCHEDULER_ONE_THREAD_PER_CONNECTION) { mysql_mutex_lock(&LOCK_thread_count); - delete thd; - thread_count--; + thd->unlink(); mysql_mutex_unlock(&LOCK_thread_count); + delete thd; + dec_thread_count(); } + my_thread_end(); return(NULL); error: