diff options
author | Monty <monty@mariadb.org> | 2015-07-10 12:49:05 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-07-10 12:49:05 +0300 |
commit | f195f93903692d4d4b459a8fb7fce3966f0cbbdc (patch) | |
tree | 5bc94de66b288461ae58c6defa18fe26a0925d9a /sql/wsrep_var.cc | |
parent | 24881437b7e0e50027361a0462126cd1ba0a5061 (diff) | |
download | mariadb-git-f195f93903692d4d4b459a8fb7fce3966f0cbbdc.tar.gz |
Cleanups, fixed warnings from valgrind, fixed failing tests (because on changes in WSREP initialization)
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r-- | sql/wsrep_var.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 6da8bbc2b74..f04d84adf4f 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -295,7 +295,11 @@ bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var) bool wsrep_provider_options_update(sys_var *self, THD* thd, enum_var_type type) { - DBUG_ASSERT(wsrep != NULL); + if (wsrep == NULL) + { + my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) not started", MYF(0)); + return true; + } wsrep_status_t ret= wsrep->options_set(wsrep, wsrep_provider_options); if (ret != WSREP_OK) @@ -497,7 +501,11 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) { - DBUG_ASSERT(wsrep != NULL); + if (wsrep == NULL) + { + my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) not started", MYF(0)); + return true; + } wsrep_status_t ret(WSREP_WARNING); if (wsrep_desync) { @@ -553,9 +561,12 @@ int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff, DBUG_ASSERT(i < maxi); - if (wsrep != NULL) { + 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++) + for (wsrep_stats_var *sv= stats; + i < maxi && sv && sv->name; i++, + sv++, v++) { v->name = thd->strdup(sv->name); switch (sv->type) { @@ -572,7 +583,6 @@ int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff, v->type = SHOW_DOUBLE; break; } - DBUG_ASSERT(i < maxi); } wsrep->stats_free(wsrep, stats); } |