summaryrefslogtreecommitdiff
path: root/ndb/src
diff options
context:
space:
mode:
authorstewart@mysql.com <>2005-08-19 00:39:56 +1000
committerstewart@mysql.com <>2005-08-19 00:39:56 +1000
commitb17e14c5ff37fcab11ef3ab4bdddefbf8d365579 (patch)
tree00418d060ffeeaebd17a35fa1eb91f2e29961cc6 /ndb/src
parenteaf3af22b7d7621344a921c98095690e70d87123 (diff)
parent10639bbdffc0470a30bc6711310459bd55e868c3 (diff)
downloadmariadb-git-b17e14c5ff37fcab11ef3ab4bdddefbf8d365579.tar.gz
merge fix
Diffstat (limited to 'ndb/src')
-rw-r--r--ndb/src/common/logger/LogHandler.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbacc/DbaccMain.cpp12
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupGen.cpp6
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp70
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp8
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.hpp6
6 files changed, 61 insertions, 43 deletions
diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp
index a9d4512112f..521bd346fd3 100644
--- a/ndb/src/common/logger/LogHandler.cpp
+++ b/ndb/src/common/logger/LogHandler.cpp
@@ -58,7 +58,7 @@ LogHandler::append(const char* pCategory, Logger::LoggerLevel level,
}
else // repeated message
{
- if (now < m_last_log_time+m_max_repeat_frequency)
+ if (now < (time_t) (m_last_log_time+m_max_repeat_frequency))
{
m_count_repeated_messages++;
m_now= now;
diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
index 1a64b8f9e1e..aefd2612151 100644
--- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
@@ -731,10 +731,12 @@ void Dbacc::execREAD_CONFIG_REQ(Signal* signal)
ndbrestart1Lab(signal);
clblPagesPerTick = 50;
- //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick);
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_ACC_SR,
+ &clblPagesPerTick);
clblPagesPerTickAfterSr = 50;
- //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr);
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_ACC,
+ &clblPagesPerTickAfterSr);
tdata0 = 0;
initialiseRecordsLab(signal, ref, senderData);
@@ -4849,16 +4851,16 @@ Uint32 Dbacc::executeNextOperation(Signal* signal)
else if(operationRecPtr.p->operation == ZWRITE)
{
jam();
- operationRecPtr.p->operation = ZINSERT;
+ operationRecPtr.p->operation = ZUPDATE;
if (operationRecPtr.p->prevParallelQue != RNIL) {
OperationrecPtr prevOpPtr;
jam();
prevOpPtr.i = operationRecPtr.p->prevParallelQue;
ptrCheckGuard(prevOpPtr, coprecsize, operationrec);
- if (prevOpPtr.p->operation != ZDELETE)
+ if (prevOpPtr.p->operation == ZDELETE)
{
jam();
- operationRecPtr.p->operation = ZUPDATE;
+ operationRecPtr.p->operation = ZINSERT;
}
}
}
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index 03f02dd0b92..f02a804aa83 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -672,10 +672,12 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
initialiseRecordsLab(signal, 0, ref, senderData);
clblPagesPerTick = 50;
- //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick);
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_TUP_SR,
+ &clblPagesPerTick);
clblPagesPerTickAfterSr = 50;
- //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr);
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_TUP,
+ &clblPagesPerTickAfterSr);
}//Dbtup::execSIZEALT_REP()
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 9f393d10528..6551ca24ee2 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -101,6 +101,7 @@ struct ndb_mgm_handle {
#ifdef MGMAPI_LOG
FILE* logfile;
#endif
+ FILE *errstream;
};
#define SET_ERROR(h, e, s) setError(h, e, __LINE__, s)
@@ -154,6 +155,7 @@ ndb_mgm_create_handle()
h->read_timeout = 50000;
h->write_timeout = 100;
h->cfg_i = -1;
+ h->errstream = stdout;
strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE);
@@ -219,6 +221,13 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle)
DBUG_VOID_RETURN;
}
+extern "C"
+void
+ndb_mgm_set_error_stream(NdbMgmHandle handle, FILE * file)
+{
+ handle->errstream = file;
+}
+
/*****************************************************************************
* Error handling
*****************************************************************************/
@@ -424,8 +433,8 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries,
#endif
if (verbose > 0) {
char buf[1024];
- ndbout_c("Unable to connect with connect string: %s",
- cfg.makeConnectString(buf,sizeof(buf)));
+ fprintf(handle->errstream, "Unable to connect with connect string: %s\n",
+ cfg.makeConnectString(buf,sizeof(buf)));
verbose= -1;
}
if (no_retries == 0) {
@@ -434,32 +443,35 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries,
"Unable to connect with connect string: %s",
cfg.makeConnectString(buf,sizeof(buf)));
if (verbose == -2)
- ndbout << ", failed." << endl;
+ fprintf(handle->errstream, ", failed.\n");
DBUG_RETURN(-1);
}
if (verbose == -1) {
- ndbout << "Retrying every " << retry_delay_in_seconds << " seconds";
+ fprintf(handle->errstream, "Retrying every %d seconds",
+ retry_delay_in_seconds);
if (no_retries > 0)
- ndbout << ". Attempts left:";
+ fprintf(handle->errstream, ". Attempts left:");
else
- ndbout << ", until connected.";;
- ndbout << flush;
+ fprintf(handle->errstream, ", until connected.");
+ fflush(handle->errstream);
verbose= -2;
}
if (no_retries > 0) {
if (verbose == -2) {
- ndbout << " " << no_retries;
- ndbout << flush;
+ fprintf(handle->errstream, " %d", no_retries);
+ fflush(handle->errstream);
}
no_retries--;
}
NdbSleep_SecSleep(retry_delay_in_seconds);
}
if (verbose == -2)
- ndbout << endl;
-
+ {
+ fprintf(handle->errstream, "\n");
+ fflush(handle->errstream);
+ }
handle->cfg_i = i;
-
+
handle->socket = sockfd;
handle->connected = 1;
@@ -511,7 +523,9 @@ ndb_mgm_match_node_type(const char * type)
for(int i = 0; i<no_of_type_values; i++)
if(strcmp(type, type_values[i].str) == 0)
return type_values[i].value;
-
+ else if(strcmp(type, type_values[i].alias) == 0)
+ return type_values[i].value;
+
return NDB_MGM_NODE_TYPE_UNKNOWN;
}
@@ -1720,28 +1734,28 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n\n", buf);
break;
}
buf = "<Unspecified>";
if(!prop->get("Content-Type", &buf) ||
strcmp(buf, "ndbconfig/octet-stream") != 0){
- ndbout_c("Unhandled response type: %s", buf);
+ fprintf(handle->errstream, "Unhandled response type: %s\n", buf);
break;
}
buf = "<Unspecified>";
if(!prop->get("Content-Transfer-Encoding", &buf)
|| strcmp(buf, "base64") != 0){
- ndbout_c("Unhandled encoding: %s", buf);
+ fprintf(handle->errstream, "Unhandled encoding: %s\n", buf);
break;
}
buf = "<Content-Length Unspecified>";
Uint32 len = 0;
if(!prop->get("Content-Length", &len)){
- ndbout_c("Invalid response: %s\n", buf);
+ fprintf(handle->errstream, "Invalid response: %s\n\n", buf);
break;
}
@@ -1766,14 +1780,14 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
const int res = base64_decode(buf64, len-1, tmp);
delete[] buf64;
if(res != 0){
- ndbout_c("Failed to decode buffer");
+ fprintf(handle->errstream, "Failed to decode buffer\n");
break;
}
ConfigValuesFactory cvf;
const int res2 = cvf.unpack(tmp);
if(!res2){
- ndbout_c("Failed to unpack buffer");
+ fprintf(handle->errstream, "Failed to unpack buffer\n");
break;
}
@@ -1883,7 +1897,7 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype)
}
Uint32 _nodeid;
if(!prop->get("nodeid", &_nodeid) != 0){
- ndbout_c("ERROR Message: <nodeid Unspecified>\n");
+ fprintf(handle->errstream, "ERROR Message: <nodeid Unspecified>\n");
break;
}
nodeid= _nodeid;
@@ -1959,7 +1973,7 @@ ndb_mgm_set_int_parameter(NdbMgmHandle handle,
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n", buf);
break;
}
res= 0;
@@ -2002,7 +2016,7 @@ ndb_mgm_set_int64_parameter(NdbMgmHandle handle,
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n", buf);
break;
}
res= 0;
@@ -2045,7 +2059,7 @@ ndb_mgm_set_string_parameter(NdbMgmHandle handle,
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n", buf);
break;
}
res= 0;
@@ -2082,7 +2096,7 @@ ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n", buf);
break;
}
if (purged) {
@@ -2164,7 +2178,7 @@ ndb_mgm_set_connection_int_parameter(NdbMgmHandle handle,
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n", buf);
break;
}
res= 0;
@@ -2206,14 +2220,14 @@ ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle,
do {
const char * buf;
if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
- ndbout_c("ERROR Message: %s\n", buf);
+ fprintf(handle->errstream, "ERROR Message: %s\n", buf);
break;
}
res= 0;
} while(0);
if(!prop->get("value",(Uint32*)value)){
- ndbout_c("Unable to get value");
+ fprintf(handle->errstream, "Unable to get value\n");
res = -4;
}
@@ -2265,7 +2279,7 @@ ndb_mgm_get_mgmd_nodeid(NdbMgmHandle handle)
CHECK_REPLY(prop, 0);
if(!prop->get("nodeid",&nodeid)){
- ndbout_c("Unable to get value");
+ fprintf(handle->errstream, "Unable to get value\n");
return 0;
}
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index 34a2d8c1302..3df878065a7 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -915,7 +915,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
- KEY_INTERNAL,
+ CFG_DB_LCP_DISC_PAGES_TUP_SR,
"NoOfDiskPagesToDiskDuringRestartTUP",
DB_TOKEN,
"?",
@@ -927,7 +927,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
- KEY_INTERNAL,
+ CFG_DB_LCP_DISC_PAGES_TUP,
"NoOfDiskPagesToDiskAfterRestartTUP",
DB_TOKEN,
"?",
@@ -939,7 +939,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
- KEY_INTERNAL,
+ CFG_DB_LCP_DISC_PAGES_ACC_SR,
"NoOfDiskPagesToDiskDuringRestartACC",
DB_TOKEN,
"?",
@@ -951,7 +951,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE(MAX_INT_RNIL) },
{
- KEY_INTERNAL,
+ CFG_DB_LCP_DISC_PAGES_ACC,
"NoOfDiskPagesToDiskAfterRestartACC",
DB_TOKEN,
"?",
diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp
index 871ee62040e..788619db7fe 100644
--- a/ndb/src/mgmsrv/ConfigInfo.hpp
+++ b/ndb/src/mgmsrv/ConfigInfo.hpp
@@ -127,14 +127,14 @@ private:
Properties m_info;
Properties m_systemDefaults;
- static const ParamInfo m_ParamInfo[];
- static const int m_NoOfParams;
-
static const AliasPair m_sectionNameAliases[];
static const char* m_sectionNames[];
static const int m_noOfSectionNames;
public:
+ static const ParamInfo m_ParamInfo[];
+ static const int m_NoOfParams;
+
static const SectionRule m_SectionRules[];
static const ConfigRule m_ConfigRules[];
static const int m_NoOfRules;