summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gni/root@dev3-127.(none)>2006-08-29 11:22:02 +0800
committerunknown <gni/root@dev3-127.(none)>2006-08-29 11:22:02 +0800
commit78f2987e19f894c530163a48fadeba11f2151a82 (patch)
treeb079cadebfff779a056f11559d5ce4c29d80fe02
parentb1f606327d521bcf72ac0c8b9877d252d7792d08 (diff)
parentf066f62580a0d256b426e546082e68fddbf380b8 (diff)
downloadmariadb-git-78f2987e19f894c530163a48fadeba11f2151a82.tar.gz
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
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index 5a0e186679f..a85e7f75ccb 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -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;
}
//*****************************************************************************