Commit 4521a532 authored by Jan Lindström's avatar Jan Lindström

Fix merge error.

parent 79180d87
......@@ -1473,7 +1473,8 @@ end:
thd->tx_read_only= false;
#ifdef WITH_WSREP
if (WSREP(thd)) {
if (WSREP(thd))
{
// sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX));
// sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack.
LEX *old_lex= thd->lex, new_lex;
......@@ -1486,10 +1487,9 @@ end:
ret= Events::drop_event(thd, dbname, name, FALSE);
#ifdef WITH_WSREP
WSREP_TO_ISOLATION_END;
error:
#endif
thd->tx_read_only= save_tx_read_only;
thd->security_ctx->master_access= saved_master_access;
}
......
......@@ -1131,7 +1131,7 @@ Events::load_events_from_db(THD *thd)
#ifdef WITH_WSREP
// when SST from master node who initials event, the event status is ENABLED
// this is problematic because there are two nodes with same events and both enabled.
if (et->originator != thd->variables.server_id)
if (WSREP(thd) && et->originator != thd->variables.server_id)
{
store_record(table, record[1]);
table->field[ET_FIELD_STATUS]->
......
......@@ -1910,21 +1910,19 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
if (ticket->get_ctx() != requestor_ctx &&
ticket->is_incompatible_when_granted(type_arg))
{
if (IF_WSREP(!WSREP_ON, 0))
break;
#ifdef WITH_WSREP
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->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))
{
wsrep_can_grant= FALSE;
if (wsrep_log_conflicts)
if (wsrep_log_conflicts)
{
MDL_lock * lock = ticket->get_lock();
WSREP_INFO(
......@@ -1936,11 +1934,13 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg,
else
can_grant= TRUE;
/* Continue loop */
#else
break;
#endif /* WITH_WSREP */
}
}
if ((ticket == NULL) && IF_WSREP(wsrep_can_grant, 1))
can_grant= TRUE;
can_grant= TRUE; /* Incompatible locks are our own. */
}
}
#ifdef WITH_WSREP
......
......@@ -2727,6 +2727,15 @@ bool change_password(THD *thd, const char *host, const char *user,
}
end:
close_mysql_tables(thd);
#ifdef WITH_WSREP
if (WSREP(thd) && !thd->wsrep_applier)
{
WSREP_TO_ISOLATION_END;
thd->query_string = query_save;
thd->wsrep_exec_mode = LOCAL_STATE;
}
#endif /* WITH_WSREP */
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment