Skip to content

Commit 616271b

Browse files
author
Nirbhay Choubey
committed
Cleanup: MDL_context::wsrep_get_thd() is no longer needed
1 parent 16702ec commit 616271b

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

sql/mdl.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
15331533
DBUG_ASSERT(ticket->get_lock());
15341534
#ifdef WITH_WSREP
15351535
if ((this == &(ticket->get_lock()->m_waiting)) &&
1536-
wsrep_thd_is_BF((void *)(ticket->get_ctx()->wsrep_get_thd()), false))
1536+
wsrep_thd_is_BF((void *)(ticket->get_ctx()->get_thd()), false))
15371537
{
15381538
Ticket_iterator itw(ticket->get_lock()->m_waiting);
15391539
Ticket_iterator itg(ticket->get_lock()->m_granted);
@@ -1544,11 +1544,11 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
15441544

15451545
while ((waiting= itw++) && !added)
15461546
{
1547-
if (!wsrep_thd_is_BF((void *)(waiting->get_ctx()->wsrep_get_thd()), true))
1547+
if (!wsrep_thd_is_BF((void *)(waiting->get_ctx()->get_thd()), true))
15481548
{
15491549
WSREP_DEBUG("MDL add_ticket inserted before: %lu %s",
1550-
wsrep_thd_thread_id(waiting->get_ctx()->wsrep_get_thd()),
1551-
wsrep_thd_query(waiting->get_ctx()->wsrep_get_thd()));
1550+
wsrep_thd_thread_id(waiting->get_ctx()->get_thd()),
1551+
wsrep_thd_query(waiting->get_ctx()->get_thd()));
15521552
/* Insert the ticket before the first non-BF waiting thd. */
15531553
m_list.insert_after(prev, ticket);
15541554
added= true;
@@ -1949,12 +1949,12 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
19491949
ticket->is_incompatible_when_granted(type_arg))
19501950
#ifdef WITH_WSREP
19511951
{
1952-
if (wsrep_thd_is_BF((void *)(requestor_ctx->wsrep_get_thd()),false) &&
1952+
if (wsrep_thd_is_BF((void *)(requestor_ctx->get_thd()),false) &&
19531953
key.mdl_namespace() == MDL_key::GLOBAL)
19541954
{
19551955
WSREP_DEBUG("global lock granted for BF: %lu %s",
1956-
wsrep_thd_thread_id(requestor_ctx->wsrep_get_thd()),
1957-
wsrep_thd_query(requestor_ctx->wsrep_get_thd()));
1956+
wsrep_thd_thread_id(requestor_ctx->get_thd()),
1957+
wsrep_thd_query(requestor_ctx->get_thd()));
19581958
can_grant = true;
19591959
}
19601960
else if (!wsrep_grant_mdl_exception(requestor_ctx, ticket, &key))
@@ -1990,12 +1990,12 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
19901990
#ifdef WITH_WSREP
19911991
else
19921992
{
1993-
if (wsrep_thd_is_BF((void *)(requestor_ctx->wsrep_get_thd()), false) &&
1993+
if (wsrep_thd_is_BF((void *)(requestor_ctx->get_thd()), false) &&
19941994
key.mdl_namespace() == MDL_key::GLOBAL)
19951995
{
19961996
WSREP_DEBUG("global lock granted for BF (waiting queue): %lu %s",
1997-
wsrep_thd_thread_id(requestor_ctx->wsrep_get_thd()),
1998-
wsrep_thd_query(requestor_ctx->wsrep_get_thd()));
1997+
wsrep_thd_thread_id(requestor_ctx->get_thd()),
1998+
wsrep_thd_query(requestor_ctx->get_thd()));
19991999
can_grant = true;
20002000
}
20012001
}

sql/mdl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,6 @@ class MDL_context
933933

934934
public:
935935
#ifdef WITH_WSREP
936-
THD *wsrep_get_thd() const { return get_thd(); }
937936
bool wsrep_has_explicit_locks();
938937
#endif /* WITH_WSREP */
939938
THD *get_thd() const { return m_owner->get_thd(); }

sql/wsrep_mysqld.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,8 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
15201520
/* Fallback to the non-wsrep behaviour */
15211521
if (!WSREP_ON) return FALSE;
15221522

1523-
THD *request_thd = requestor_ctx->wsrep_get_thd();
1524-
THD *granted_thd = ticket->get_ctx()->wsrep_get_thd();
1523+
THD *request_thd = requestor_ctx->get_thd();
1524+
THD *granted_thd = ticket->get_ctx()->get_thd();
15251525
bool ret = FALSE;
15261526

15271527
const char* schema= key->db_name();

0 commit comments

Comments
 (0)