summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-04-21 13:46:05 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2020-04-24 13:12:46 +0300
commit93475aff8de80a0ef53cbee924bcb70de6e86f2c (patch)
tree2f4c902df61d26323495d498e34aa52265508c2b /sql/mdl.cc
parent9398c3dfa5f8c2b2b5bc51dbf079e3edd343ae9e (diff)
downloadmariadb-git-93475aff8de80a0ef53cbee924bcb70de6e86f2c.tar.gz
MDEV-22203: WSREP_ON is unnecessarily expensive to evaluate
Replaced WSREP_ON macro by single global variable WSREP_ON that is then updated at server statup and on wsrep_on and wsrep_provider update functions.
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 591127dc1d8..54128c2ee97 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1215,12 +1215,12 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
wsrep_thd_is_BF(ticket->get_ctx()->get_thd(), false))
{
Ticket_iterator itw(ticket->get_lock()->m_waiting);
-
- DBUG_ASSERT(WSREP_ON);
MDL_ticket *waiting;
MDL_ticket *prev=NULL;
bool added= false;
+ DBUG_ASSERT(WSREP(ticket->get_ctx()->get_thd()));
+
while ((waiting= itw++) && !added)
{
if (!wsrep_thd_is_BF(waiting->get_ctx()->get_thd(), true))