summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/wsrep_server_state.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 268c8114d83..3e664491bac 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1879,6 +1879,7 @@ extern "C" void unireg_abort(int exit_code)
#ifdef WITH_WSREP
if (WSREP_ON &&
+ Wsrep_server_state::is_inited() &&
Wsrep_server_state::instance().state() != wsrep::server_state::s_disconnected)
{
/*
@@ -5108,6 +5109,7 @@ static int init_server_components()
#ifdef WITH_WSREP
if (wsrep_init_server()) unireg_abort(1);
+
if (WSREP_ON && !wsrep_recovery && !opt_abort)
{
if (opt_bootstrap) // bootsrap option given - disable wsrep functionality
diff --git a/sql/wsrep_server_state.h b/sql/wsrep_server_state.h
index 34ff4105180..1ef937300f6 100644
--- a/sql/wsrep_server_state.h
+++ b/sql/wsrep_server_state.h
@@ -35,11 +35,17 @@ public:
const wsrep::gtid& initial_position,
int max_protocol_version);
static void destroy();
+
static Wsrep_server_state& instance()
{
return *m_instance;
}
+ static bool is_inited()
+ {
+ return (m_instance != NULL);
+ }
+
static wsrep::provider& get_provider()
{
return instance().provider();