summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-10-12 12:14:13 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-12 12:14:13 +0300
commita992c615a66341ec4c86d0f97fcdb36e3b837a54 (patch)
treede1e5af122d35443a964c10d68c287022da084f6 /sql/sql_alter.cc
parent15edd69ddf649ebf7ecab3fa72bc5dea263c0154 (diff)
parent977c385df36dcb751720dc838521b7cb5a328cb9 (diff)
downloadmariadb-git-a992c615a66341ec4c86d0f97fcdb36e3b837a54.tar.gz
Merge 10.5 into 10.6
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 be305267076..a21933892de 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -508,8 +508,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