Merge branch '11.2' into 11.3

This commit is contained in:
Oleksandr Byelkin 2023-11-14 18:33:03 +01:00
commit 34272bd6a5
618 changed files with 17141 additions and 9714 deletions

View file

@ -2384,7 +2384,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);