diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 733d281efd5..17beb413e7f 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1107,6 +1107,14 @@ static int check_connection(THD *thd) bool setup_connection_thread_globals(THD *thd) { + + DBUG_EXECUTE_IF("CONNECT_wait", { + extern MYSQL_SOCKET unix_sock; + DBUG_ASSERT(unix_sock.fd >= 0); + while (unix_sock.fd >= 0) + my_sleep(1000); + }); + if (thd->store_globals()) { close_connection(thd, ER_OUT_OF_RESOURCES); @@ -1360,14 +1368,6 @@ void do_handle_one_connection(CONNECT *connect) return; } - DBUG_EXECUTE_IF("CONNECT_wait", - { - extern MYSQL_SOCKET unix_sock; - DBUG_ASSERT(unix_sock.fd >= 0); - while (unix_sock.fd >= 0) - my_sleep(1000); - }); - /* If a thread was created to handle this connection: increment slow_launch_threads counter if it took more than diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 4195bf21e48..38848f3c237 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -222,14 +222,6 @@ static THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data) { THD *thd= NULL; - DBUG_EXECUTE_IF("CONNECT_wait", - { - extern MYSQL_SOCKET unix_sock; - DBUG_ASSERT(unix_sock.fd >= 0); - while (unix_sock.fd >= 0) - my_sleep(1000); - }); - /* Create a new connection context: mysys_thread_var and PSI thread Store them in THD.