summaryrefslogtreecommitdiff
path: root/sql/sql_sequence.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-02-01 20:33:04 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2022-02-01 20:33:04 +0100
commitcf63eecef44f189ce2d221612dee9dfc1885ba4e (patch)
tree93b4e6645a1d371bd8012a0aa8e6e3a3d541b2a6 /sql/sql_sequence.cc
parentfb40a2fabf8d8cf765c83a0b8e609dd893c75ec3 (diff)
parentc04a203a10e282e1f33fd04d8a1b7ff0b076bce5 (diff)
downloadmariadb-git-cf63eecef44f189ce2d221612dee9dfc1885ba4e.tar.gz
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r--sql/sql_sequence.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index 307a0b29c57..91ee97f7822 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -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;
@@ -905,6 +910,13 @@ bool Sql_cmd_alter_sequence::execute(THD *thd)
if (check_grant(thd, ALTER_ACL, first_table, FALSE, 1, FALSE))
DBUG_RETURN(TRUE); /* purecov: inspected */
+#ifdef WITH_WSREP
+ if (WSREP_ON && WSREP(thd) &&
+ wsrep_to_isolation_begin(thd, first_table->db.str,
+ first_table->table_name.str,
+ first_table))
+ DBUG_RETURN(TRUE);
+#endif /* WITH_WSREP */
if (if_exists())
thd->push_internal_handler(&no_such_table_handler);
error= open_and_lock_tables(thd, first_table, FALSE, 0);