summaryrefslogtreecommitdiff
path: root/ndb/src/mgmsrv
diff options
context:
space:
mode:
authorunknown <tulin@dl145b.mysql.com>2005-09-05 16:33:40 +0200
committerunknown <tulin@dl145b.mysql.com>2005-09-05 16:33:40 +0200
commit4a584b17e81c636f4819b9923e54c0ec1efeaa84 (patch)
tree9555ee9a3c4892310e27df273613d39786e7d3b1 /ndb/src/mgmsrv
parent354fa102a3294fe349a428d1507433165581caec (diff)
downloadmariadb-git-4a584b17e81c636f4819b9923e54c0ec1efeaa84.tar.gz
added --core-file option to ndb executables
added parseable printout in ndb_restore
Diffstat (limited to 'ndb/src/mgmsrv')
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp16
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp34
-rw-r--r--ndb/src/mgmsrv/Services.cpp2
3 files changed, 31 insertions, 21 deletions
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index cface035174..36a72dcb975 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -25,6 +25,7 @@
#include <m_string.h>
extern my_bool opt_ndb_shm;
+extern my_bool opt_core;
#define MAX_LINE_LENGTH 255
#define KEY_INTERNAL 0
@@ -2140,11 +2141,10 @@ static void require(bool v)
{
if(!v)
{
-#ifndef DBUG_OFF
- abort();
-#else
- exit(-1);
-#endif
+ if (opt_core)
+ abort();
+ else
+ exit(-1);
}
}
@@ -2214,7 +2214,7 @@ ConfigInfo::ConfigInfo()
ndbout << "Error: Parameter " << param._fname
<< " defined twice in section " << param._section
<< "." << endl;
- exit(-1);
+ require(false);
}
// Add new pinfo to section
@@ -2264,7 +2264,7 @@ ConfigInfo::ConfigInfo()
ndbout << "Check that each entry has a section failed." << endl;
ndbout << "Parameter \"" << m_ParamInfo[i]._fname << endl;
ndbout << "Edit file " << __FILE__ << "." << endl;
- exit(-1);
+ require(false);
}
if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION)
@@ -2277,7 +2277,7 @@ ConfigInfo::ConfigInfo()
<< "\" does not exist in section \""
<< m_ParamInfo[i]._section << "\"." << endl;
ndbout << "Edit file " << __FILE__ << "." << endl;
- exit(-1);
+ require(false);
}
}
}
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 452dabc50e0..acab2ef9eac 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -65,6 +65,18 @@
extern int global_flag_send_heartbeat_now;
extern int g_no_nodeid_checks;
+extern my_bool opt_core;
+
+static void require(bool v)
+{
+ if(!v)
+ {
+ if (opt_core)
+ abort();
+ else
+ exit(-1);
+ }
+}
void *
MgmtSrvr::logLevelThread_C(void* m)
@@ -436,14 +448,14 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
if (tmp_nodeid == 0)
{
ndbout_c(m_config_retriever->getErrorString());
- exit(-1);
+ require(false);
}
// read config from other managent server
_config= fetchConfig();
if (_config == 0)
{
ndbout << m_config_retriever->getErrorString() << endl;
- exit(-1);
+ require(false);
}
_ownNodeId= tmp_nodeid;
}
@@ -454,7 +466,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
_config= readConfig();
if (_config == 0) {
ndbout << "Unable to read config file" << endl;
- exit(-1);
+ require(false);
}
}
@@ -511,7 +523,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
if ((m_node_id_mutex = NdbMutex_Create()) == 0)
{
ndbout << "mutex creation failed line = " << __LINE__ << endl;
- exit(-1);
+ require(false);
}
if (_ownNodeId == 0) // we did not get node id from other server
@@ -522,7 +534,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
0, 0, error_string)){
ndbout << "Unable to obtain requested nodeid: "
<< error_string.c_str() << endl;
- exit(-1);
+ require(false);
}
_ownNodeId = tmp;
}
@@ -533,7 +545,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
_ownNodeId))
{
ndbout << m_config_retriever->getErrorString() << endl;
- exit(-1);
+ require(false);
}
}
@@ -2203,18 +2215,18 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
iter(*(ndb_mgm_configuration *)_config->m_configValues, CFG_SECTION_NODE);
for(iter.first(); iter.valid(); iter.next()) {
unsigned tmp= 0;
- if(iter.get(CFG_NODE_ID, &tmp)) abort();
+ if(iter.get(CFG_NODE_ID, &tmp)) require(false);
if (*nodeId && *nodeId != tmp)
continue;
found_matching_id= true;
- if(iter.get(CFG_TYPE_OF_SECTION, &type_c)) abort();
+ if(iter.get(CFG_TYPE_OF_SECTION, &type_c)) require(false);
if(type_c != (unsigned)type)
continue;
found_matching_type= true;
if (connected_nodes.get(tmp))
continue;
found_free_node= true;
- if(iter.get(CFG_NODE_HOST, &config_hostname)) abort();
+ if(iter.get(CFG_NODE_HOST, &config_hostname)) require(false);
if (config_hostname && config_hostname[0] == 0)
config_hostname= 0;
else if (client_addr) {
@@ -2561,7 +2573,7 @@ MgmtSrvr::backupCallback(BackupEvent & event)
int
MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted)
{
- abort();
+ require(false);
return 0;
}
@@ -2715,7 +2727,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
ndbout_c("Updating node %d param: %d to %s", node, param, val_char);
break;
default:
- abort();
+ require(false);
}
assert(res);
} while(node == 0 && iter.next() == 0);
diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp
index 00cf6390c73..46bfb531b61 100644
--- a/ndb/src/mgmsrv/Services.cpp
+++ b/ndb/src/mgmsrv/Services.cpp
@@ -343,8 +343,6 @@ MgmApiSession::getConfig_old(Parser_t::Context &ctx) {
}
#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */
-inline void require(bool b){ if(!b) abort(); }
-
void
MgmApiSession::getConfig(Parser_t::Context &ctx,
const class Properties &args) {