summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-07-07 22:26:44 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-07-07 22:26:44 -0400
commit8154ef4b16fe140a42f3e90903192bb3b0fec041 (patch)
treef575db32c47a794dd12bc2afc4f8925da5512979 /sql/wsrep_var.cc
parentb08c4201facca0501a6f6978068aaee9f9638b16 (diff)
downloadmariadb-git-8154ef4b16fe140a42f3e90903192bb3b0fec041.tar.gz
MDEV-7067: Server outputs Galera (WSREP) information, even if Galera is disabled
Additional changes : * On startup, do not initialize wsrep if wsrep_on=0. * On shutdown, stop wsrep replication only if > 0 wsrep threads are running.
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r--sql/wsrep_var.cc43
1 files changed, 22 insertions, 21 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index a6c2bafef13..6da8bbc2b74 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -552,33 +552,34 @@ int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff,
*v++= wsrep_status_vars[i];
DBUG_ASSERT(i < maxi);
- DBUG_ASSERT(wsrep != NULL);
- wsrep_stats_var* stats= wsrep->stats_get(wsrep);
- for (wsrep_stats_var *sv= stats; i < maxi && sv && sv->name; i++, sv++, v++)
- {
- v->name = thd->strdup(sv->name);
- switch (sv->type) {
- case WSREP_VAR_INT64:
- v->value = (char*)thd->memdup(&sv->value._int64, sizeof(longlong));
- v->type = SHOW_LONGLONG;
- break;
- case WSREP_VAR_STRING:
- v->value = thd->strdup(sv->value._string);
- v->type = SHOW_CHAR;
- break;
- case WSREP_VAR_DOUBLE:
- v->value = (char*)thd->memdup(&sv->value._double, sizeof(double));
- v->type = SHOW_DOUBLE;
- break;
+ if (wsrep != NULL) {
+ wsrep_stats_var* stats= wsrep->stats_get(wsrep);
+ for (wsrep_stats_var *sv= stats; i < maxi && sv && sv->name; i++, sv++, v++)
+ {
+ v->name = thd->strdup(sv->name);
+ switch (sv->type) {
+ case WSREP_VAR_INT64:
+ v->value = (char*)thd->memdup(&sv->value._int64, sizeof(longlong));
+ v->type = SHOW_LONGLONG;
+ break;
+ case WSREP_VAR_STRING:
+ v->value = thd->strdup(sv->value._string);
+ v->type = SHOW_CHAR;
+ break;
+ case WSREP_VAR_DOUBLE:
+ v->value = (char*)thd->memdup(&sv->value._double, sizeof(double));
+ v->type = SHOW_DOUBLE;
+ break;
+ }
+ DBUG_ASSERT(i < maxi);
}
- DBUG_ASSERT(i < maxi);
+ wsrep->stats_free(wsrep, stats);
}
- wsrep->stats_free(wsrep, stats);
my_qsort(buff, i, sizeof(*v), show_var_cmp);
- v->name= 0; // terminator
+ v->name= 0; // terminator
return 0;
}