diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2017-03-17 19:18:53 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2017-03-17 19:20:08 +0000 |
commit | 6c5cfbbf3399887baff489f089641385c112c9a0 (patch) | |
tree | 716e2e3b9c7ac112d241ab72794de63fc3d677b8 /sql/sql_connect.cc | |
parent | a77ac6513e4ecc9a91c49cab06c5c5ade1c1e10b (diff) | |
download | mariadb-git-6c5cfbbf3399887baff489f089641385c112c9a0.tar.gz |
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.
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r-- | sql/sql_connect.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 5cb4cd87296..157e59c2446 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -832,7 +832,11 @@ bool init_new_connection_handler_thread() statistic_increment(connection_errors_internal, &LOCK_status); 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; } |