diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-21 15:20:34 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-08-21 15:20:34 +0300 |
commit | 9258097fa3617b720b2b518060c0d09a00455051 (patch) | |
tree | 0d9e98513620fdb440f1d0f78351ca794a0f731d /sql/wsrep_thd.cc | |
parent | cdc8debcaad6ee18ff7a146ab3f365367fe8ec93 (diff) | |
parent | dc7c080369472f6f33344299d2e3d01619edf885 (diff) | |
download | mariadb-git-9258097fa3617b720b2b518060c0d09a00455051.tar.gz |
Merge 10.1 into 10.2
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 15eed2e10e6..1621559bb8a 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -677,3 +677,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; + } +} |