summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-06 09:00:52 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-06 09:00:52 +0200
commit2a791c53ad93c8bc1441dd227000234bd49c4990 (patch)
tree4c52ad715c99bd3c6681771d7cb77d451a34e216 /sql/wsrep_thd.cc
parentb5c72a843abee033e9ea6028e1a109f03afc4455 (diff)
parent723ffdb32ee785cbc511abc457eb70d41c2fcce3 (diff)
downloadmariadb-git-2a791c53ad93c8bc1441dd227000234bd49c4990.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index 556163ad03d..b849bc256cb 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -397,3 +397,21 @@ bool wsrep_bf_abort(const THD* bf_thd, THD* victim_thd)
return ret;
}
+/*
+ Get auto increment variables for THD. Use global settings for
+ applier threads.
+ */
+void wsrep_thd_auto_increment_variables(THD* thd,
+ unsigned long long* offset,
+ unsigned long long* increment)
+{
+ if (wsrep_thd_is_applying(thd) &&
+ thd->wsrep_trx().state() != wsrep::transaction::s_replaying)
+ {
+ *offset= global_system_variables.auto_increment_offset;
+ *increment= global_system_variables.auto_increment_increment;
+ return;
+ }
+ *offset= thd->variables.auto_increment_offset;
+ *increment= thd->variables.auto_increment_increment;
+}