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

MDEV-27365 CREATE-or-REPLACE SEQUENCE is binlogged without DDL flag

CREATE-OR-REPLACE SEQUENCE is not logged with Gtid event DDL flag
which affects its slave parallel execution.
Unlike other DDL:s it can occur in concurrent execution with following transactions
which can lead to various errors, including asserts like

(mdl_request->type != MDL_INTENTION_EXCLUSIVE && mdl_request->type != MDL_EXCLUSIVE) || !(get_thd()->rgi_slave && get_thd()->rgi_slave->is_parallel_exec && lock->check_if_conflicting_replication_locks(this)

in MDL_context::acquire_lock.

Fixed to wrap internal statement level commit with save-
and-restore of TRANS_THD::m_unsafe_rollback_flags.
This commit is contained in:
Andrei
2021-12-26 18:13:49 +02:00
committed by Andrei Elkin
parent 5fd5e9fff3
commit 80da35a326
3 changed files with 46 additions and 3 deletions

View File

@ -365,9 +365,14 @@ bool sequence_insert(THD *thd, LEX *lex, TABLE_LIST *org_table_list)
seq->reserved_until= seq->start;
error= seq->write_initial_sequence(table);
if (trans_commit_stmt(thd))
error= 1;
{
uint save_unsafe_rollback_flags=
thd->transaction.stmt.m_unsafe_rollback_flags;
if (trans_commit_stmt(thd))
error= 1;
thd->transaction.stmt.m_unsafe_rollback_flags=
save_unsafe_rollback_flags;
}
if (trans_commit_implicit(thd))
error= 1;