summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-06-27 18:15:47 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-06-27 18:15:47 -0400
commit48a0a66ffa3241c91324606911f7964e956bc99f (patch)
treea575448e6ac256e61880de9eda4273448e4192c0 /sql/wsrep_var.cc
parent7f9fcfe00efa7262b0b95e00a595083ab0e21426 (diff)
downloadmariadb-git-48a0a66ffa3241c91324606911f7964e956bc99f.tar.gz
MDEV-10186: mysqld crash when runtime setting wsrep_cluster_address without wsrep_on=ON
On wsrep_cluster_address update, node restarts the replication and attempts to connect to the new address. In this process it makes a call to wsrep provider's connect API, which could lead to segfault if wsrep provider is not loaded (wsrep_on=OFF). Fixed by making sure that it proceeds only if a provider is loaded.
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r--sql/wsrep_var.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 9c01e54f48d..fb784cbcca3 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -348,7 +348,16 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var)
bool wsrep_cluster_address_update (sys_var *self, THD* thd, enum_var_type type)
{
- bool wsrep_on_saved= thd->variables.wsrep_on;
+ bool wsrep_on_saved;
+
+ /* Do not proceed if wsrep provider is not loaded. */
+ if (!wsrep)
+ {
+ WSREP_INFO("wsrep provider is not loaded, can't re(start) replication.");
+ return false;
+ }
+
+ wsrep_on_saved= thd->variables.wsrep_on;
thd->variables.wsrep_on= false;
/* stop replication is heavy operation, and includes closing all client