Merge branch '10.5' into 10.6

This commit is contained in:
Oleksandr Byelkin 2023-11-08 15:57:05 +01:00
commit b83c379420
381 changed files with 10243 additions and 5792 deletions

View file

@ -2387,7 +2387,17 @@ void rpl_group_info::slave_close_thread_tables(THD *thd)
{
DBUG_ENTER("rpl_group_info::slave_close_thread_tables(THD *thd)");
thd->get_stmt_da()->set_overwrite_status(true);
thd->is_error() ? trans_rollback_stmt(thd) : trans_commit_stmt(thd);
#ifdef WITH_WSREP
// This can happen e.g. when table_def::compatible_with fails and sets a error
// but thd->is_error() is false then. However, we do not want to commit
// statement on Galera instead we want to rollback it as later in
// apply_write_set we rollback transaction and that can't be done
// after wsrep transaction state is s_committed.
if (WSREP(thd))
(thd->is_error() || thd->is_slave_error) ? trans_rollback_stmt(thd) : trans_commit_stmt(thd);
else
#endif
thd->is_error() ? trans_rollback_stmt(thd) : trans_commit_stmt(thd);
thd->get_stmt_da()->set_overwrite_status(false);
close_thread_tables(thd);