diff options
Diffstat (limited to '')
-rw-r--r-- | sql/wsrep_var.cc | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index d4af7a95..c55d713e 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -27,6 +27,7 @@ #include <cstdlib> #include "wsrep_trans_observer.h" #include "wsrep_server_state.h" +#include "wsrep_plugin.h" /* wsrep_provider_plugin_is_enabled() */ ulong wsrep_reject_queries; @@ -93,12 +94,17 @@ static bool refresh_provider_options() } } +bool wsrep_refresh_provider_options() +{ + return refresh_provider_options(); +} + void wsrep_set_wsrep_on(THD* thd) { if (thd) thd->wsrep_was_on= WSREP_ON_; - WSREP_PROVIDER_EXISTS_= wsrep_provider && - strncasecmp(wsrep_provider, WSREP_NONE, FN_REFLEN); + WSREP_PROVIDER_EXISTS_= wsrep_provider && *wsrep_provider && + strcasecmp(wsrep_provider, WSREP_NONE); WSREP_ON_= global_system_variables.wsrep_on && WSREP_PROVIDER_EXISTS_; } @@ -108,10 +114,14 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) { my_bool saved_wsrep_on= global_system_variables.wsrep_on; - thd->variables.wsrep_on= global_system_variables.wsrep_on; + thd->variables.wsrep_on= saved_wsrep_on; // If wsrep has not been inited we need to do it now - if (global_system_variables.wsrep_on && wsrep_provider && !wsrep_inited) + if (!wsrep_inited && + saved_wsrep_on && + wsrep_provider && + *wsrep_provider && + strcasecmp(wsrep_provider, WSREP_NONE)) { // wsrep_init() rewrites provide if it fails char* tmp= strdup(wsrep_provider); @@ -198,36 +208,6 @@ bool wsrep_on_check(sys_var *self, THD* thd, set_var* var) return false; } -bool wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type) -{ - 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; - } - - // update global settings too. - 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; - } - - return false; -} - -bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type) -{ - thd->variables.wsrep_causal_reads= thd->variables.wsrep_sync_wait & - WSREP_SYNC_WAIT_BEFORE_READ; - - // update global settings too - global_system_variables.wsrep_causal_reads= global_system_variables.wsrep_sync_wait & - WSREP_SYNC_WAIT_BEFORE_READ; - - return false; -} - template<typename T> static T parse_value(char** startptr, char** endptr) { @@ -447,6 +427,12 @@ static int wsrep_provider_verify (const char* provider_str) bool wsrep_provider_check (sys_var *self, THD* thd, set_var* var) { + if (wsrep_provider_plugin_enabled()) + { + my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->var->name.str, "read only"); + return true; + } + char wsrep_provider_buf[FN_REFLEN]; if ((! var->save_result.string_value.str) || @@ -538,6 +524,11 @@ bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var) my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) not started", MYF(0)); return true; } + if (wsrep_provider_plugin_enabled()) + { + my_error(ER_INCORRECT_GLOBAL_LOCAL_VAR, MYF(0), var->var->name.str, "read only"); + return true; + } return false; } |