summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-10-13 10:56:57 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-13 10:56:57 +0300
commit5197d81cdb59c3d5881cec9fbc607218ff1bde4f (patch)
tree376fc075b124b5016b53f693356969386bf0f18e /sql/sql_alter.cc
parent55e07d9ade51e9e969f528d903509806142f4d1e (diff)
parent618d82064618bda06bcd080af5b664b3d173dbe3 (diff)
downloadmariadb-git-5197d81cdb59c3d5881cec9fbc607218ff1bde4f.tar.gz
Merge 10.8 into 10.9
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r--sql/sql_alter.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 1d5875733ac..ffcc7679273 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -513,8 +513,18 @@ bool Sql_cmd_alter_table::execute(THD *thd)
DBUG_RETURN(TRUE);
}
- thd->variables.auto_increment_offset = 1;
- thd->variables.auto_increment_increment = 1;
+ /*
+ It makes sense to set auto_increment_* to defaults in TOI operations.
+ Must be done before wsrep_TOI_begin() since Query_log_event encapsulating
+ TOI statement and auto inc variables for wsrep replication is constructed
+ there. Variables are reset back in THD::reset_for_next_command() before
+ processing of next command.
+ */
+ if (wsrep_auto_increment_control)
+ {
+ thd->variables.auto_increment_offset = 1;
+ thd->variables.auto_increment_increment = 1;
+ }
}
#endif