diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index d76f18a52bb..54fb484bad0 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1762,13 +1762,11 @@ pthread_handler_t start_wsrep_THD(void *arg) THD *thd; wsrep_thd_processor_fun processor= (wsrep_thd_processor_fun)arg; - if (my_thread_init() || (!(thd= new THD(true)))) + if (my_thread_init() || (!(thd= new THD(next_thread_id(), true)))) { goto error; } - thd->thread_id= next_thread_id(); - mysql_mutex_lock(&LOCK_thread_count); if (wsrep_gtid_mode)