summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-08-12 14:50:26 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-08-12 14:50:26 -0400
commit8ec02bb836ab43d115579e6ba14f669e7dcd3e82 (patch)
treef1b28e036cfe058bcb780de7301168f8db6a42a0 /sql/wsrep_var.cc
parent857abf148149d0d7a73dc6364b5bf3d19e58a7d1 (diff)
downloadmariadb-git-8ec02bb836ab43d115579e6ba14f669e7dcd3e82.tar.gz
bzr merge -c4123 codership/5.6/
(minus http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/4122)
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r--sql/wsrep_var.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index b965c26c184..2272945535d 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -60,11 +60,29 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
return false;
}
-void wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type)
-{
- if (var_type == OPT_GLOBAL) {
- thd->variables.wsrep_causal_reads = global_system_variables.wsrep_causal_reads;
+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;
+ } 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;
+ return false;
}
static int wsrep_start_position_verify (const char* start_str)