Cleanup: MDL_context::wsrep_get_thd() is no longer needed
This commit is contained in:
parent
16702ec95f
commit
616271b7c9
20
sql/mdl.cc
20
sql/mdl.cc
@ -1533,7 +1533,7 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
|
||||
DBUG_ASSERT(ticket->get_lock());
|
||||
#ifdef WITH_WSREP
|
||||
if ((this == &(ticket->get_lock()->m_waiting)) &&
|
||||
wsrep_thd_is_BF((void *)(ticket->get_ctx()->wsrep_get_thd()), false))
|
||||
wsrep_thd_is_BF((void *)(ticket->get_ctx()->get_thd()), false))
|
||||
{
|
||||
Ticket_iterator itw(ticket->get_lock()->m_waiting);
|
||||
Ticket_iterator itg(ticket->get_lock()->m_granted);
|
||||
@ -1544,11 +1544,11 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
|
||||
|
||||
while ((waiting= itw++) && !added)
|
||||
{
|
||||
if (!wsrep_thd_is_BF((void *)(waiting->get_ctx()->wsrep_get_thd()), true))
|
||||
if (!wsrep_thd_is_BF((void *)(waiting->get_ctx()->get_thd()), true))
|
||||
{
|
||||
WSREP_DEBUG("MDL add_ticket inserted before: %lu %s",
|
||||
wsrep_thd_thread_id(waiting->get_ctx()->wsrep_get_thd()),
|
||||
wsrep_thd_query(waiting->get_ctx()->wsrep_get_thd()));
|
||||
wsrep_thd_thread_id(waiting->get_ctx()->get_thd()),
|
||||
wsrep_thd_query(waiting->get_ctx()->get_thd()));
|
||||
/* Insert the ticket before the first non-BF waiting thd. */
|
||||
m_list.insert_after(prev, ticket);
|
||||
added= true;
|
||||
@ -1949,12 +1949,12 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
|
||||
ticket->is_incompatible_when_granted(type_arg))
|
||||
#ifdef WITH_WSREP
|
||||
{
|
||||
if (wsrep_thd_is_BF((void *)(requestor_ctx->wsrep_get_thd()),false) &&
|
||||
if (wsrep_thd_is_BF((void *)(requestor_ctx->get_thd()),false) &&
|
||||
key.mdl_namespace() == MDL_key::GLOBAL)
|
||||
{
|
||||
WSREP_DEBUG("global lock granted for BF: %lu %s",
|
||||
wsrep_thd_thread_id(requestor_ctx->wsrep_get_thd()),
|
||||
wsrep_thd_query(requestor_ctx->wsrep_get_thd()));
|
||||
wsrep_thd_thread_id(requestor_ctx->get_thd()),
|
||||
wsrep_thd_query(requestor_ctx->get_thd()));
|
||||
can_grant = true;
|
||||
}
|
||||
else if (!wsrep_grant_mdl_exception(requestor_ctx, ticket, &key))
|
||||
@ -1990,12 +1990,12 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
|
||||
#ifdef WITH_WSREP
|
||||
else
|
||||
{
|
||||
if (wsrep_thd_is_BF((void *)(requestor_ctx->wsrep_get_thd()), false) &&
|
||||
if (wsrep_thd_is_BF((void *)(requestor_ctx->get_thd()), false) &&
|
||||
key.mdl_namespace() == MDL_key::GLOBAL)
|
||||
{
|
||||
WSREP_DEBUG("global lock granted for BF (waiting queue): %lu %s",
|
||||
wsrep_thd_thread_id(requestor_ctx->wsrep_get_thd()),
|
||||
wsrep_thd_query(requestor_ctx->wsrep_get_thd()));
|
||||
wsrep_thd_thread_id(requestor_ctx->get_thd()),
|
||||
wsrep_thd_query(requestor_ctx->get_thd()));
|
||||
can_grant = true;
|
||||
}
|
||||
}
|
||||
|
@ -933,7 +933,6 @@ private:
|
||||
|
||||
public:
|
||||
#ifdef WITH_WSREP
|
||||
THD *wsrep_get_thd() const { return get_thd(); }
|
||||
bool wsrep_has_explicit_locks();
|
||||
#endif /* WITH_WSREP */
|
||||
THD *get_thd() const { return m_owner->get_thd(); }
|
||||
|
@ -1520,8 +1520,8 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
|
||||
/* Fallback to the non-wsrep behaviour */
|
||||
if (!WSREP_ON) return FALSE;
|
||||
|
||||
THD *request_thd = requestor_ctx->wsrep_get_thd();
|
||||
THD *granted_thd = ticket->get_ctx()->wsrep_get_thd();
|
||||
THD *request_thd = requestor_ctx->get_thd();
|
||||
THD *granted_thd = ticket->get_ctx()->get_thd();
|
||||
bool ret = FALSE;
|
||||
|
||||
const char* schema= key->db_name();
|
||||
|
Loading…
x
Reference in New Issue
Block a user