diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-28 12:22:56 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-28 12:22:56 +0300 |
commit | 7830fb7f45b3824c0375c00ae2cab357165904cf (patch) | |
tree | 730521737fdc48e69f7650819e9a29da6487e1f4 /sql/wsrep_thd.cc | |
parent | b805ebd7ed49868f83e6fd3fe72a11ddacdce452 (diff) | |
parent | 55163ba1bdb1a05daadc66c41c959994231b361c (diff) | |
download | mariadb-git-7830fb7f45b3824c0375c00ae2cab357165904cf.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r-- | sql/wsrep_thd.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index ce6d9688cb3..a83ea4ce1c6 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -676,3 +676,25 @@ bool wsrep_thd_has_explicit_locks(THD *thd) assert(thd); return thd->mdl_context.has_explicit_locks(); } + +/* + Get auto increment variables for THD. Use global settings for + applier threads. + */ +extern "C" +void wsrep_thd_auto_increment_variables(THD* thd, + unsigned long long* offset, + unsigned long long* increment) +{ + if (thd->wsrep_exec_mode == REPL_RECV && + thd->wsrep_conflict_state != REPLAYING) + { + *offset= global_system_variables.auto_increment_offset; + *increment= global_system_variables.auto_increment_increment; + } + else + { + *offset= thd->variables.auto_increment_offset; + *increment= thd->variables.auto_increment_increment; + } +} |