BUG#19873 Running any command in ndb_mgm can automatically reconnect the...

BUG#19873 Running any command in ndb_mgm can automatically reconnect the server after restarting the ndb_mgmd.
          connect command in the ndb_mgm can connect or reconnect the management server successfully
parent 76d4e65a
...@@ -704,6 +704,12 @@ CommandInterpreter::execute_impl(const char *_line) ...@@ -704,6 +704,12 @@ CommandInterpreter::execute_impl(const char *_line)
if (!connect()) if (!connect())
DBUG_RETURN(true); DBUG_RETURN(true);
if (ndb_mgm_check_connection(m_mgmsrv))
{
disconnect();
connect();
}
if (strcasecmp(firstToken, "SHOW") == 0) { if (strcasecmp(firstToken, "SHOW") == 0) {
Guard g(m_print_mutex); Guard g(m_print_mutex);
executeShow(allAfterFirstToken); executeShow(allAfterFirstToken);
...@@ -1314,11 +1320,16 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -1314,11 +1320,16 @@ CommandInterpreter::executeShow(char* parameters)
void void
CommandInterpreter::executeConnect(char* parameters) CommandInterpreter::executeConnect(char* parameters)
{ {
BaseString *basestring = NULL;
disconnect(); disconnect();
if (!emptyString(parameters)) { if (!emptyString(parameters)) {
m_constr= BaseString(parameters).trim().c_str(); basestring= new BaseString(parameters);
m_constr= basestring->trim().c_str();
} }
connect(); connect();
if (basestring != NULL)
delete basestring;
} }
//***************************************************************************** //*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment