diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-02-05 14:59:27 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-02-12 18:14:20 +0100 |
commit | 9703cffa8cb57e2fe29719f4aae3282bfae82878 (patch) | |
tree | 9e9d6a7dcf0f7ceff47091b47465a06613fc2dcb /sql/log_event.cc | |
parent | 259a1902a066d01547e5d70ba0e4837d1be62e7b (diff) | |
download | mariadb-git-9703cffa8cb57e2fe29719f4aae3282bfae82878.tar.gz |
don't take mutexes conditionally
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 52995cc7e66..89ffebf2659 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9049,16 +9049,14 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi) res= trans_commit(thd); /* Automatically rolls back on error. */ thd->release_transactional_locks(); + mysql_mutex_lock(&thd->LOCK_thd_data); #ifdef WITH_WSREP - if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data); - if ((!res || (WSREP(thd) && thd->wsrep_trx().state() == wsrep::transaction::s_must_replay )) && sub_id) + if (sub_id && (!res || (WSREP(thd) && thd->wsrep_trx().state() == wsrep::transaction::s_must_replay))) #else - if (likely(!res) && sub_id) + if (sub_id && !res) #endif /* WITH_WSREP */ rpl_global_gtid_slave_state->update_state_hash(sub_id, >id, hton, rgi); -#ifdef WITH_WSREP - if (WSREP(thd)) mysql_mutex_unlock(&thd->LOCK_thd_data); -#endif /* WITH_WSREP */ + mysql_mutex_unlock(&thd->LOCK_thd_data); /* Increment the global status commit count variable */ |