summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.(none)>2004-08-20 10:39:25 +0000
committerunknown <tomas@poseidon.(none)>2004-08-20 10:39:25 +0000
commit89d155aa5776f815e6ec6ffd145afe7e9143806f (patch)
tree41a3f2b00ea61db3b8212329e63e05dcf7ec4b48 /ndb
parentd31e9cf78d17231b986909d94c3b3da983744859 (diff)
parent792c4c23b08c21fd467179c998c874f54ee7ec77 (diff)
downloadmariadb-git-89d155aa5776f815e6ec6ffd145afe7e9143806f.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.(none):/home/tomas/mysql-4.1 ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/main.cpp133
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp2
-rw-r--r--ndb/test/ndbapi/testIndex.cpp2
-rw-r--r--ndb/test/ndbapi/testNdbApi.cpp3
-rw-r--r--ndb/test/ndbapi/testRestartGci.cpp2
-rw-r--r--ndb/test/ndbapi/testScan.cpp1
-rw-r--r--ndb/test/run-test/main.cpp4
-rw-r--r--ndb/test/src/HugoOperations.cpp2
-rw-r--r--ndb/test/tools/cpcc.cpp2
9 files changed, 91 insertions, 60 deletions
diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp
index e68c266c394..24cb1820575 100644
--- a/ndb/src/kernel/main.cpp
+++ b/ndb/src/kernel/main.cpp
@@ -41,7 +41,9 @@
extern EventLogger g_eventLogger;
void catchsigs(bool ignore); // for process signal handling
-extern "C" void handler(int signo); // for process signal handling
+
+extern "C" void handler_shutdown(int signum); // for process signal handling
+extern "C" void handler_error(int signum); // for process signal handling
// Shows system information
void systemInfo(const Configuration & conf,
@@ -248,74 +250,91 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
}
+static void
+handler_register(int signum, sighandler_t handler, bool ignore)
+{
+ if (ignore) {
+ if(signum != SIGCHLD)
+ signal(signum, SIG_IGN);
+ } else
+ signal(signum, handler);
+}
+
void
catchsigs(bool ignore){
#if ! defined NDB_SOFTOSE && !defined NDB_OSE
-#if defined SIGRTMIN
- #define MAX_SIG_CATCH SIGRTMIN
-#elif defined NSIG
- #define MAX_SIG_CATCH NSIG
-#else
- #error "neither SIGRTMIN or NSIG is defined on this platform, please report bug at bugs.mysql.com"
+ static const int signals_shutdown[] = {
+#ifdef SIGBREAK
+ SIGBREAK,
#endif
-
- // Makes the main process catch process signals, eg installs a
- // handler named "handler". "handler" will then be called is instead
- // of the defualt process signal handler)
- if(ignore){
- for(int i = 1; i < MAX_SIG_CATCH; i++){
- if(i != SIGCHLD)
- signal(i, SIG_IGN);
- }
- } else {
- for(int i = 1; i < MAX_SIG_CATCH; i++){
- signal(i, handler);
- }
- }
+ SIGHUP,
+ SIGINT,
+#if defined SIGPWR
+ SIGPWR,
+#elif defined SIGINFO
+ SIGINFO,
#endif
-}
-
-extern "C"
-void
-handler(int sig){
- switch(sig){
- case SIGHUP: /* 1 - Hang up */
- case SIGINT: /* 2 - Interrupt */
- case SIGQUIT: /* 3 - Quit */
- case SIGTERM: /* 15 - Terminate */
-#ifdef SIGPWR
- case SIGPWR: /* 19 - Power fail */
+ SIGQUIT,
+ SIGTERM,
+#ifdef SIGTSTP
+ SIGTSTP,
+#endif
+ SIGTTIN,
+ SIGTTOU
+ };
+
+ static const int signals_error[] = {
+ SIGABRT,
+ SIGALRM,
+#ifdef SIGBUS
+ SIGBUS,
+#endif
+ SIGCHLD,
+ SIGFPE,
+ SIGILL,
+#ifdef SIGIO
+ SIGIO,
#endif
#ifdef SIGPOLL
- case SIGPOLL: /* 22 */
+ SIGPOLL,
#endif
- case SIGSTOP: /* 23 */
- case SIGTSTP: /* 24 */
- case SIGTTIN: /* 26 */
- case SIGTTOU: /* 27 */
- globalData.theRestartFlag = perform_stop;
- break;
-#ifdef SIGWINCH
- case SIGWINCH:
+ SIGSEGV,
+#ifdef SIGTRAP
+ SIGTRAP
#endif
- case SIGPIPE:
- /**
- * Can happen in TCP Transporter
- *
- * Just ignore
- */
- break;
- default:
- // restart the system
- char errorData[40];
- snprintf(errorData, 40, "Signal %d received", sig);
- ERROR_SET(fatal, 0, errorData, __FILE__);
- break;
- }
+ };
+#endif
+
+ static const int signals_ignore[] = {
+ SIGPIPE
+ };
+
+ for(size_t i = 0; i < sizeof(signals_shutdown)/sizeof(signals_shutdown[0]); i++)
+ handler_register(signals_shutdown[i], handler_shutdown, ignore);
+ for(size_t i = 0; i < sizeof(signals_error)/sizeof(signals_error[0]); i++)
+ handler_register(signals_error[i], handler_error, ignore);
+ for(size_t i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++)
+ handler_register(signals_ignore[i], SIG_IGN, ignore);
+}
+
+extern "C"
+void
+handler_shutdown(int signum){
+ g_eventLogger.info("Received signal %d. Performing stop.", signum);
+ globalData.theRestartFlag = perform_stop;
+}
+
+extern "C"
+void
+handler_error(int signum){
+ g_eventLogger.info("Received signal %d. Running error handler.", signum);
+ // restart the system
+ char errorData[40];
+ snprintf(errorData, 40, "Signal %d received", signum);
+ ERROR_SET(fatal, 0, errorData, __FILE__);
}
-
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 624f0a132a3..587d5a7572d 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -2835,7 +2835,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
p_type++;
if(iter.get(param, &val_64) == 0){
- val_64 = atoll(value);
+ val_64 = strtoll(value, 0, 10);
break;
}
p_type++;
diff --git a/ndb/test/ndbapi/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp
index 1241f09fc45..a0844cee8f8 100644
--- a/ndb/test/ndbapi/testIndex.cpp
+++ b/ndb/test/ndbapi/testIndex.cpp
@@ -1529,4 +1529,4 @@ int main(int argc, const char** argv){
return testIndex.execute(argc, argv);
}
-
+template class Vector<Attrib*>;
diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp
index 2e08ebbed4e..5b171d42578 100644
--- a/ndb/test/ndbapi/testNdbApi.cpp
+++ b/ndb/test/ndbapi/testNdbApi.cpp
@@ -1010,4 +1010,5 @@ int main(int argc, const char** argv){
return testNdbApi.execute(argc, argv);
}
-
+template class Vector<Ndb*>;
+template class Vector<NdbConnection*>;
diff --git a/ndb/test/ndbapi/testRestartGci.cpp b/ndb/test/ndbapi/testRestartGci.cpp
index e3dd1f8e2ce..54d38654ff2 100644
--- a/ndb/test/ndbapi/testRestartGci.cpp
+++ b/ndb/test/ndbapi/testRestartGci.cpp
@@ -216,3 +216,5 @@ NDBT_TESTSUITE_END(testRestartGci);
int main(int argc, const char** argv){
return testRestartGci.execute(argc, argv);
}
+
+template class Vector<SavedRecord>;
diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp
index 3da0ceb6d8c..3d8b37df0ca 100644
--- a/ndb/test/ndbapi/testScan.cpp
+++ b/ndb/test/ndbapi/testScan.cpp
@@ -1404,3 +1404,4 @@ int main(int argc, const char** argv){
return testScan.execute(argc, argv);
}
+template class Vector<Attrib*>;
diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp
index 90e14a39296..9d20da8c1f9 100644
--- a/ndb/test/run-test/main.cpp
+++ b/ndb/test/run-test/main.cpp
@@ -988,3 +988,7 @@ setup_hosts(atrt_config& config){
}
template class Vector<const ParserRow<SimpleCpcClient::ParserDummy>*>;
+template class Vector<SimpleCpcClient::Process>;
+template class Vector<Vector<SimpleCpcClient::Process> >;
+template class Vector<atrt_host>;
+template class Vector<atrt_process>;
diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp
index d8e733f6142..7c05cb86a93 100644
--- a/ndb/test/src/HugoOperations.cpp
+++ b/ndb/test/src/HugoOperations.cpp
@@ -796,3 +796,5 @@ HugoOperations::scanReadRecords(Ndb* pNdb, NdbScanOperation::LockMode lm,
return 0;
}
+
+template class Vector<HugoOperations::RsPair>;
diff --git a/ndb/test/tools/cpcc.cpp b/ndb/test/tools/cpcc.cpp
index 488bd812681..e1468df3290 100644
--- a/ndb/test/tools/cpcc.cpp
+++ b/ndb/test/tools/cpcc.cpp
@@ -348,3 +348,5 @@ Operate::evaluate(SimpleCpcClient* c, const SimpleCpcClient::Process & pp){
}
template class Vector<const ParserRow<SimpleCpcClient::ParserDummy>*>;
+template class Vector<Expression*>;
+template class Vector<SimpleCpcClient*>;