summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-11-19 17:48:36 +0100
committerSergei Golubchik <serg@mariadb.org>2015-11-19 17:48:36 +0100
commit7f19330c595e3183d079fe2c18eecc74740e8f83 (patch)
tree8b853976cd14d96d5415757be525133b32be0c93 /sql/mdl.cc
parent4046ed12bcddfd831c510b022cb7af224be9457b (diff)
parentf4421c893b50f05078f14d33c47d21f52f59f8a7 (diff)
downloadmariadb-git-7f19330c595e3183d079fe2c18eecc74740e8f83.tar.gz
Merge branch 'github/10.0-galera' into 10.1
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index ec380aa7432..73b64b35dff 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1069,7 +1069,7 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
wait_result= mysql_cond_wait(&m_COND_wait_status, &m_LOCK_wait_status);
}
else
-#endif
+#endif /* WITH_WSREP */
wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status,
abs_timeout);
}
@@ -1170,7 +1170,8 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
if (granted->get_ctx() != ticket->get_ctx() &&
granted->is_incompatible_when_granted(ticket->get_type()))
{
- if (!wsrep_grant_mdl_exception(ticket->get_ctx(), granted))
+ if (!wsrep_grant_mdl_exception(ticket->get_ctx(), granted,
+ &ticket->get_lock()->key))
{
WSREP_DEBUG("MDL victim killed at add_ticket");
}
@@ -1561,7 +1562,7 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
wsrep_thd_query(requestor_ctx->get_thd()));
can_grant = true;
}
- else if (!wsrep_grant_mdl_exception(requestor_ctx, ticket))
+ else if (!wsrep_grant_mdl_exception(requestor_ctx, ticket, &key))
{
wsrep_can_grant= FALSE;
if (wsrep_log_conflicts)
@@ -2904,6 +2905,19 @@ void MDL_context::release_explicit_locks()
release_locks_stored_before(MDL_EXPLICIT, NULL);
}
+bool MDL_context::has_explicit_locks()
+{
+ MDL_ticket *ticket = NULL;
+
+ Ticket_iterator it(m_tickets[MDL_EXPLICIT]);
+
+ while ((ticket = it++))
+ {
+ return true;
+ }
+
+ return false;
+}
#ifdef WITH_WSREP
void MDL_ticket::wsrep_report(bool debug)