1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2022-03-29 12:59:18 +03:00
86 changed files with 2875 additions and 251 deletions

View File

@ -1163,8 +1163,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);
}
@ -1310,7 +1309,13 @@ bool do_command(THD *thd)
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));
@ -1383,6 +1388,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);
}