[Commits] 616271b: Cleanup: MDL_context::wsrep_get_thd() is no longer needed

Nirbhay Choubey nirbhay at mariadb.com
Thu Sep 1 19:53:47 EEST 2016


revision-id: 616271b7c9f69596df740a8fec5a4f39b959d064 (mariadb-galera-10.0.27-1-g616271b)
parent(s): 16702ec95f301d1a21eb5a6f5531387c9254b952
author: Nirbhay Choubey
committer: Nirbhay Choubey
timestamp: 2016-09-01 12:53:44 -0400
message:

Cleanup: MDL_context::wsrep_get_thd() is no longer needed

---
 sql/mdl.cc          | 20 ++++++++++----------
 sql/mdl.h           |  1 -
 sql/wsrep_mysqld.cc |  4 ++--
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/sql/mdl.cc b/sql/mdl.cc
index 1e7502a..0f1c961 100644
--- a/sql/mdl.cc
+++ b/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 @@ void MDL_lock::reschedule_waiters()
             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 @@ void MDL_lock::reschedule_waiters()
 #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;
     }
   }
diff --git a/sql/mdl.h b/sql/mdl.h
index 7fc58bc..86f681c 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -933,7 +933,6 @@ class MDL_context
 
 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(); }
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 4117d52..13b72b6 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1520,8 +1520,8 @@ void wsrep_to_isolation_end(THD *thd)
   /* 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();


More information about the commits mailing list