mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.8 into 10.9
This commit is contained in:
@ -1141,8 +1141,7 @@ static bool wsrep_tables_accessible_when_detached(const TABLE_LIST *tables)
|
||||
|
||||
static bool wsrep_command_no_result(char command)
|
||||
{
|
||||
return (command == COM_STMT_PREPARE ||
|
||||
command == COM_STMT_FETCH ||
|
||||
return (command == COM_STMT_FETCH ||
|
||||
command == COM_STMT_SEND_LONG_DATA ||
|
||||
command == COM_STMT_CLOSE);
|
||||
}
|
||||
@ -1340,7 +1339,13 @@ dispatch_command_return do_command(THD *thd, bool blocking)
|
||||
DBUG_ASSERT(!thd->mdl_context.has_locks());
|
||||
DBUG_ASSERT(!thd->get_stmt_da()->is_set());
|
||||
/* We let COM_QUIT and COM_STMT_CLOSE to execute even if wsrep aborted. */
|
||||
if (command != COM_STMT_CLOSE &&
|
||||
if (command == COM_STMT_EXECUTE)
|
||||
{
|
||||
WSREP_DEBUG("PS BF aborted at do_command");
|
||||
thd->wsrep_delayed_BF_abort= true;
|
||||
}
|
||||
if (command != COM_STMT_CLOSE &&
|
||||
command != COM_STMT_EXECUTE &&
|
||||
command != COM_QUIT)
|
||||
{
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
@ -1423,6 +1428,17 @@ out:
|
||||
if (unlikely(wsrep_service_started))
|
||||
wsrep_after_command_after_result(thd);
|
||||
}
|
||||
|
||||
if (thd->wsrep_delayed_BF_abort)
|
||||
{
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
WSREP_DEBUG("Deadlock error for PS query: %s", thd->query());
|
||||
thd->reset_killed();
|
||||
thd->mysys_var->abort = 0;
|
||||
thd->wsrep_retry_counter = 0;
|
||||
|
||||
thd->wsrep_delayed_BF_abort= false;
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
DBUG_RETURN(return_value);
|
||||
}
|
||||
@ -9391,15 +9407,17 @@ sql_kill_user(THD *thd, LEX_USER *user, killed_state state)
|
||||
{
|
||||
uint error;
|
||||
ha_rows rows;
|
||||
if (likely(!(error= kill_threads_for_user(thd, user, state, &rows))))
|
||||
my_ok(thd, rows);
|
||||
else
|
||||
switch (error= kill_threads_for_user(thd, user, state, &rows))
|
||||
{
|
||||
/*
|
||||
This is probably ER_OUT_OF_RESOURCES, but in the future we may
|
||||
want to write the name of the user we tried to kill
|
||||
*/
|
||||
my_error(error, MYF(0), user->host.str, user->user.str);
|
||||
case 0:
|
||||
my_ok(thd, rows);
|
||||
break;
|
||||
case ER_KILL_DENIED_ERROR:
|
||||
my_error(error, MYF(0), (long long) thd->thread_id);
|
||||
break;
|
||||
case ER_OUT_OF_RESOURCES:
|
||||
default:
|
||||
my_error(error, MYF(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user