summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2014-09-30 18:06:15 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2014-09-30 18:06:15 -0400
commit9a57de86beda0032a6dd9f804822e2651eb869bf (patch)
tree7c1b645c0f4e4392c3c47da46f4c5d08b0c28a86 /sql/wsrep_var.cc
parentc916085e271cd049537b1e07b36cd060c44750bd (diff)
downloadmariadb-git-9a57de86beda0032a6dd9f804822e2651eb869bf.tar.gz
bzr merge -r4123..4144 codership/5.6
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r--sql/wsrep_var.cc34
1 files changed, 21 insertions, 13 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 2272945535d..e917c8f7d42 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -62,26 +62,34 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
bool wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type)
{
- // global setting should not affect session setting.
- // if (var_type == OPT_GLOBAL) {
- // thd->variables.wsrep_causal_reads = global_system_variables.wsrep_causal_reads;
- // }
- if (thd->variables.wsrep_causal_reads) {
- thd->variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ;
+ // wsrep_sync_wait should also be updated.
+ if (var_type == OPT_GLOBAL) {
+ if (global_system_variables.wsrep_causal_reads) {
+ global_system_variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ;
+ } else {
+ global_system_variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ;
+ }
} else {
- thd->variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ;
+ if (thd->variables.wsrep_causal_reads) {
+ thd->variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ;
+ } else {
+ thd->variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ;
+ }
}
+
return false;
}
bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type)
{
- // global setting should not affect session setting.
- // if (var_type == OPT_GLOBAL) {
- // thd->variables.wsrep_sync_wait = global_system_variables.wsrep_sync_wait;
- // }
- thd->variables.wsrep_causal_reads = thd->variables.wsrep_sync_wait &
- WSREP_SYNC_WAIT_BEFORE_READ;
+ // wsrep_causal_reads should also be updated.
+ if (var_type == OPT_GLOBAL) {
+ global_system_variables.wsrep_causal_reads=
+ global_system_variables.wsrep_sync_wait & WSREP_SYNC_WAIT_BEFORE_READ;
+ } else {
+ thd->variables.wsrep_causal_reads=
+ thd->variables.wsrep_sync_wait & WSREP_SYNC_WAIT_BEFORE_READ;
+ }
return false;
}