summaryrefslogtreecommitdiff
path: root/ndb/test
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2004-11-22 10:47:59 +0000
committerunknown <tomas@poseidon.ndb.mysql.com>2004-11-22 10:47:59 +0000
commit404b1524857330187a01209465758e2e02ad8bdb (patch)
tree9495d3d7a7337377dae4e90f978598422dd05090 /ndb/test
parent366ef4faebf354e28afbcf104635a1400e99cbeb (diff)
downloadmariadb-git-404b1524857330187a01209465758e2e02ad8bdb.tar.gz
removed unused variables
assigned "localhost" as default connectstring added a disconnect() first in connect() removed double implementation of connect code, use connect() in NdbRestarter removed extra "host=" in connectstring ndb/include/mgmapi/mgmapi.h: removed wrong comment ndb/test/include/NdbRestarter.hpp: removed unused variables ndb/test/src/NdbBackup.cpp: removed double implementation of connect code, use connect() in NdbRestarter removed extra "host=" in connectstring ndb/test/src/NdbRestarter.cpp: removed unused variables assigned "localhost" as default connectstring added a disconnect() first in connect()
Diffstat (limited to 'ndb/test')
-rw-r--r--ndb/test/include/NdbRestarter.hpp2
-rw-r--r--ndb/test/src/NdbBackup.cpp33
-rw-r--r--ndb/test/src/NdbRestarter.cpp4
3 files changed, 15 insertions, 24 deletions
diff --git a/ndb/test/include/NdbRestarter.hpp b/ndb/test/include/NdbRestarter.hpp
index 114726f6a2b..19a88b4f8ad 100644
--- a/ndb/test/include/NdbRestarter.hpp
+++ b/ndb/test/include/NdbRestarter.hpp
@@ -87,8 +87,6 @@ protected:
bool connected;
BaseString addr;
- BaseString host;
- int port;
NdbMgmHandle handle;
ndb_mgm_configuration * m_config;
protected:
diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp
index 398a7c32fc4..655fdda7c95 100644
--- a/ndb/test/src/NdbBackup.cpp
+++ b/ndb/test/src/NdbBackup.cpp
@@ -69,26 +69,19 @@ NdbBackup::getBackupDataDirForNode(int _node_id){
/**
* Fetch configuration from management server
*/
- ConfigRetriever cr(0, 0, NODE_TYPE_API);
- ndb_mgm_configuration * p = 0;
-
- BaseString tmp; tmp.assfmt("%s:%d", host.c_str(), port);
- NdbMgmHandle handle = ndb_mgm_create_handle();
- if(handle == 0 ||
- ndb_mgm_set_connectstring(handle,tmp.c_str()) != 0 ||
- ndb_mgm_connect(handle,0,0,0) != 0 ||
- (p = ndb_mgm_get_configuration(handle, 0)) == 0){
-
- const char * s = 0;
- if(p == 0 && handle != 0){
- s = ndb_mgm_get_latest_error_msg(handle);
- if(s == 0)
- s = "No error given!";
+ ndb_mgm_configuration *p;
+ if (connect())
+ return NULL;
+
+ if ((p = ndb_mgm_get_configuration(handle, 0)) == 0)
+ {
+ const char * s= ndb_mgm_get_latest_error_msg(handle);
+ if(s == 0)
+ s = "No error given!";
- ndbout << "Could not fetch configuration" << endl;
- ndbout << s << endl;
- return NULL;
- }
+ ndbout << "Could not fetch configuration" << endl;
+ ndbout << s << endl;
+ return NULL;
}
/**
@@ -153,7 +146,7 @@ NdbBackup::execRestore(bool _restore_data,
ndbout << "scp res: " << res << endl;
- BaseString::snprintf(buf, 255, "%sndb_restore -c \"host=%s\" -n %d -b %d %s %s .",
+ BaseString::snprintf(buf, 255, "%sndb_restore -c \"%s\" -n %d -b %d %s %s .",
#if 1
"",
#else
diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp
index e1802f36e82..1c5fbbabb42 100644
--- a/ndb/test/src/NdbRestarter.cpp
+++ b/ndb/test/src/NdbRestarter.cpp
@@ -32,12 +32,11 @@
NdbRestarter::NdbRestarter(const char* _addr):
connected(false),
- port(-1),
handle(NULL),
m_config(0)
{
if (_addr == NULL){
- addr.assign("");
+ addr.assign("localhost");
} else {
addr.assign(_addr);
}
@@ -360,6 +359,7 @@ NdbRestarter::isConnected(){
int
NdbRestarter::connect(){
+ disconnect();
handle = ndb_mgm_create_handle();
if (handle == NULL){
g_err << "handle == NULL" << endl;