Commit 3cca8f5b authored by unknown's avatar unknown
Browse files

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


ndb/src/mgmclient/CommandInterpreter.cpp:
  1.After restarting the ndb_mgmd, running any command in ndb_mgm will automatically reconnect the server firstly.
  2.The connect command in the ndb_mgm can connect or reconnect the management server successfully.
parent 1bd553d4
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -704,6 +704,12 @@ CommandInterpreter::execute_impl(const char *_line)
  if (!connect())
    DBUG_RETURN(true);

  if (ndb_mgm_check_connection(m_mgmsrv))
  {
    disconnect();
    connect();
  }

  if (strcasecmp(firstToken, "SHOW") == 0) {
    Guard g(m_print_mutex);
    executeShow(allAfterFirstToken);
@@ -1314,11 +1320,16 @@ CommandInterpreter::executeShow(char* parameters)
void
CommandInterpreter::executeConnect(char* parameters) 
{
  BaseString *basestring = NULL;

  disconnect();
  if (!emptyString(parameters)) {
    m_constr= BaseString(parameters).trim().c_str();
    basestring= new BaseString(parameters);
    m_constr= basestring->trim().c_str();
  }
  connect();
  if (basestring != NULL)
    delete basestring;
}

//*****************************************************************************