summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2017-11-16 21:14:59 +0200
committerAndrei Elkin <andrei.elkin@mariadb.com>2017-11-16 21:14:59 +0200
commit24bb6be9dc672f6cb1d88bd2d4cdab1ab87502fc (patch)
tree7b85a8cde1e060b0e267830b21370996d323ddfe /sql/sql_class.cc
parent7759ad6e6ab5a29b4fb7a1b8f4d97166e288647c (diff)
downloadmariadb-git-bb-10.2-semisync.tar.gz
MDEV-13073. Fixed failing on BB sys_vars.rpl_semi_sync_master_enabled_basic. The issue forced to add up aan argument to THD::THD and THD::init to propagate skip of a mutex locking. The lock could not be released instead as this leads to clear deadlock; the test is received a piece for concurrent ack thread start/stop.bb-10.2-semisync
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index afd0c375718..a97ad06c7f6 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -693,7 +693,7 @@ extern "C" void thd_kill_timeout(THD* thd)
}
-THD::THD(my_thread_id id, bool is_wsrep_applier)
+THD::THD(my_thread_id id, bool is_wsrep_applier, bool skip_global_sys_var_lock)
:Statement(&main_lex, &main_mem_root, STMT_CONVENTIONAL_EXECUTION,
/* statement id */ 0),
rli_fake(0), rgi_fake(0), rgi_slave(NULL),
@@ -880,7 +880,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
/* Call to init() below requires fully initialized Open_tables_state. */
reset_open_tables_state(this);
- init();
+ init(skip_global_sys_var_lock);
#if defined(ENABLED_PROFILING)
profiling.set_thd(this);
#endif
@@ -1237,10 +1237,11 @@ extern "C" my_thread_id next_thread_id_noinline()
Init common variables that has to be reset on start and on change_user
*/
-void THD::init(void)
+void THD::init(bool skip_lock)
{
DBUG_ENTER("thd::init");
- mysql_mutex_lock(&LOCK_global_system_variables);
+ if (!skip_lock)
+ mysql_mutex_lock(&LOCK_global_system_variables);
plugin_thdvar_init(this);
/*
plugin_thd_var_init() sets variables= global_system_variables, which
@@ -1253,8 +1254,8 @@ void THD::init(void)
::strmake(variables.default_master_connection.str,
global_system_variables.default_master_connection.str,
variables.default_master_connection.length);
-
- mysql_mutex_unlock(&LOCK_global_system_variables);
+ if (!skip_lock)
+ mysql_mutex_unlock(&LOCK_global_system_variables);
user_time.val= start_time= start_time_sec_part= 0;