1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '11.1' into 11.2

This commit is contained in:
Oleksandr Byelkin
2024-08-03 09:50:16 +02:00
463 changed files with 12095 additions and 5097 deletions

View File

@ -320,7 +320,9 @@ Storage_engine_name::resolve_storage_engine_with_error(THD *thd,
}
*ha= NULL;
if (thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
if ((thd_sql_command(thd) != SQLCOM_CREATE_TABLE &&
thd_sql_command(thd) != SQLCOM_ALTER_TABLE) ||
thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
{
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), m_storage_engine_name.str);
return true;
@ -1556,6 +1558,22 @@ int ha_prepare(THD *thd)
error=1;
}
}
else if (thd->rgi_slave)
{
/*
Slave threads will always process XA COMMITs in the binlog handler (see
MDEV-25616 and MDEV-30423), so if this is a slave thread preparing a
transaction which proved empty during replication (e.g. because of
replication filters) then mark it as XA_ROLLBACK_ONLY so the follow up
XA COMMIT will know to roll it back, rather than try to commit and binlog
a standalone XA COMMIT (without its preceding XA START - XA PREPARE).
If the xid_cache is cleared before the completion event comes, before
issuing ER_XAER_NOTA, first check if the event targets an ignored
database, and ignore the error if so.
*/
thd->transaction->xid_state.set_rollback_only();
}
DBUG_RETURN(error);
}