Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1889 05/08/19 00:39:56 stewart@stripped +1 -0
merge fix
ndb/src/mgmapi/mgmapi.cpp
1.51 05/08/19 00:39:47 stewart@stripped +13 -3
merge
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: stewart
# Host: kennedy.(none)
# Root: /home/stewart/Documents/MySQL/5.0/bug10950/RESYNC
--- 1.50/ndb/src/mgmapi/mgmapi.cpp 2005-08-17 08:40:03 +10:00
+++ 1.51/ndb/src/mgmapi/mgmapi.cpp 2005-08-19 00:39:47 +10:00
@@ -101,6 +101,7 @@
#ifdef MGMAPI_LOG
FILE* logfile;
#endif
+ FILE *errstream;
};
#define SET_ERROR(h, e, s) setError(h, e, __LINE__, s)
@@ -154,6 +155,7 @@
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 @@
DBUG_VOID_RETURN;
}
+extern "C"
+void
+ndb_mgm_set_error_stream(NdbMgmHandle handle, FILE * file)
+{
+ handle->errstream = file;
+}
+
/*****************************************************************************
* Error handling
*****************************************************************************/
@@ -424,8 +433,8 @@
#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 @@
"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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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;
}
| Thread |
|---|
| • bk commit into 5.0 tree (stewart:1.1889) | Stewart Smith | 18 Aug |