Commit 25968b7b authored by unknown's avatar unknown
Browse files

BUG#19873 Merge dev3-127.(none):/mnt/mysql/home/ngb/mysql-5.0-ndb-bj

into  dev3-127.(none):/mnt/mysql/home/ngb/bug19873


ndb/src/mgmclient/CommandInterpreter.cpp:
  ndb_mgm can automatically reconnect to the ndb_mgmd after ndb_mgmd restarted.
  and this commit fixes probable mem leak
parents fd1b3e91 3cca8f5b
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1028,6 +1028,12 @@ CommandInterpreter::execute_impl(const char *_line, bool interactive)
  if (!connect(interactive))
    DBUG_RETURN(true);

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

  if (strcasecmp(firstToken, "SHOW") == 0) {
    Guard g(m_print_mutex);
    executeShow(allAfterFirstToken);
@@ -1640,11 +1646,16 @@ CommandInterpreter::executeShow(char* parameters)
void
CommandInterpreter::executeConnect(char* parameters, bool interactive) 
{
  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(interactive);
  connect();
  if (basestring != NULL)
    delete basestring;
}

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