Commit 6c5cfbbf authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix crash (race condition) in DBUG in connect2 test case.

When "simulate_failed_connection_1"  DBUG keyword is set, current thread's
DBUG stack points to global variable in dbug (init_settings).
This global variable could be overriden while current THD is still active,
producing crash in worst scenario.

Added DBUG_SET()so that the current thread own dbug
context that cannot concurrently modified by anyone else.
parent a77ac651
...@@ -832,7 +832,11 @@ bool init_new_connection_handler_thread() ...@@ -832,7 +832,11 @@ bool init_new_connection_handler_thread()
statistic_increment(connection_errors_internal, &LOCK_status); statistic_increment(connection_errors_internal, &LOCK_status);
return 1; return 1;
} }
DBUG_EXECUTE_IF("simulate_failed_connection_1", return(1); ); DBUG_EXECUTE_IF("simulate_failed_connection_1",
{
DBUG_SET("-d,simulate_failed_connection_1");
return(1);
});
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment