Commit 1337a630 authored by unknown's avatar unknown

Merge lzhou@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb

into  dev3-138.dev.cn.tlan:/home/zhl/mysql/mysql-5.0/mysql-5.0-ndb-bj


ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
ndb/src/ndbapi/ndberror.c:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
parents 0479a5d3 df649f2d
This diff is collapsed.
...@@ -121,7 +121,7 @@ read_and_execute(int _try_reconnect) ...@@ -121,7 +121,7 @@ read_and_execute(int _try_reconnect)
line_read= strdup(linebuffer); line_read= strdup(linebuffer);
} }
#endif #endif
return com->execute(line_read,_try_reconnect); return com->execute(line_read, _try_reconnect, 1);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
...@@ -163,7 +163,7 @@ int main(int argc, char** argv){ ...@@ -163,7 +163,7 @@ int main(int argc, char** argv){
} }
else else
{ {
com->execute(opt_execute_str,_try_reconnect, &ret); com->execute(opt_execute_str,_try_reconnect, 0, &ret);
} }
delete com; delete com;
......
...@@ -23,8 +23,8 @@ class Ndb_mgmclient ...@@ -23,8 +23,8 @@ class Ndb_mgmclient
public: public:
Ndb_mgmclient(const char*,int verbose=0); Ndb_mgmclient(const char*,int verbose=0);
~Ndb_mgmclient(); ~Ndb_mgmclient();
int execute(const char *_line, int _try_reconnect=-1, int *error= 0); int execute(const char *_line, int _try_reconnect=-1, bool interactive=1, int *error= 0);
int execute(int argc, char** argv, int _try_reconnect=-1, int *error= 0); int execute(int argc, char** argv, int _try_reconnect=-1, bool interactive=1, int *error= 0);
int disconnect(); int disconnect();
private: private:
CommandInterpreter *m_cmd; CommandInterpreter *m_cmd;
......
...@@ -2604,6 +2604,13 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -2604,6 +2604,13 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){
return false; return false;
} }
if(id >= MAX_NODES)
{
ctx.reportError("too many nodes configured, only up to %d nodes supported.",
MAX_NODES);
return false;
}
// next node id _always_ next numbers after last used id // next node id _always_ next numbers after last used id
ctx.m_userProperties.put("NextNodeId", id+1, true); ctx.m_userProperties.put("NextNodeId", id+1, true);
...@@ -3495,11 +3502,11 @@ sanity_checks(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3495,11 +3502,11 @@ sanity_checks(Vector<ConfigInfo::ConfigRuleSection>&sections,
Uint32 mgm_nodes = 0; Uint32 mgm_nodes = 0;
Uint32 api_nodes = 0; Uint32 api_nodes = 0;
if (!ctx.m_userProperties.get("DB", &db_nodes)) { if (!ctx.m_userProperties.get("DB", &db_nodes)) {
ctx.reportError("At least one database node should be defined in config file"); ctx.reportError("At least one database node (ndbd) should be defined in config file");
return false; return false;
} }
if (!ctx.m_userProperties.get("MGM", &mgm_nodes)) { if (!ctx.m_userProperties.get("MGM", &mgm_nodes)) {
ctx.reportError("At least one management server node should be defined in config file"); ctx.reportError("At least one management server node (ndb_mgmd) should be defined in config file");
return false; return false;
} }
if (!ctx.m_userProperties.get("API", &api_nodes)) { if (!ctx.m_userProperties.get("API", &api_nodes)) {
......
...@@ -449,7 +449,10 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, ...@@ -449,7 +449,10 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
// read config locally // read config locally
_config= readConfig(); _config= readConfig();
if (_config == 0) { if (_config == 0) {
ndbout << "Unable to read config file" << endl; if (config_filename != NULL)
ndbout << "Invalid configuration file: " << config_filename << endl;
else
ndbout << "Invalid configuration file" << endl;
exit(-1); exit(-1);
} }
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "../mgmapi/ndb_logevent.hpp" #include "../mgmapi/ndb_logevent.hpp"
#include <base64.h> #include <base64.h>
#include <ndberror.h>
extern bool g_StopServer; extern bool g_StopServer;
extern bool g_RestartServer; extern bool g_RestartServer;
...@@ -1325,6 +1326,12 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) ...@@ -1325,6 +1326,12 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId)
if (ndb_logevent_body[i].index_fn) if (ndb_logevent_body[i].index_fn)
val= (*(ndb_logevent_body[i].index_fn))(val); val= (*(ndb_logevent_body[i].index_fn))(val);
str.appfmt("%s=%d\n",ndb_logevent_body[i].token, val); str.appfmt("%s=%d\n",ndb_logevent_body[i].token, val);
if(strcmp(ndb_logevent_body[i].token,"error") == 0)
{
int m_text_len= strlen(m_text);
snprintf(m_text+m_text_len, 4 , " - ");
ndb_error_string(theData[3], m_text+(m_text_len+3), sizeof(m_text)-m_text_len-3);
}
} }
Vector<NDB_SOCKET_TYPE> copy; Vector<NDB_SOCKET_TYPE> copy;
......
...@@ -378,7 +378,7 @@ ErrorBundle ErrorCodes[] = { ...@@ -378,7 +378,7 @@ ErrorBundle ErrorCodes[] = {
{ 1305, IE, "Backup definition not implemented" }, { 1305, IE, "Backup definition not implemented" },
{ 1306, AE, "Backup not supported in diskless mode (change Diskless)" }, { 1306, AE, "Backup not supported in diskless mode (change Diskless)" },
{ 1321, IE, "Backup aborted by application" }, { 1321, UD, "Backup aborted by user request" },
{ 1322, IE, "Backup already completed" }, { 1322, IE, "Backup already completed" },
{ 1323, IE, "1323" }, { 1323, IE, "1323" },
{ 1324, IE, "Backup log buffer full" }, { 1324, IE, "Backup log buffer full" },
......
...@@ -147,7 +147,7 @@ static long ndb_cluster_node_id= 0; ...@@ -147,7 +147,7 @@ static long ndb_cluster_node_id= 0;
static const char * ndb_connected_host= 0; static const char * ndb_connected_host= 0;
static long ndb_connected_port= 0; static long ndb_connected_port= 0;
static long ndb_number_of_replicas= 0; static long ndb_number_of_replicas= 0;
static long ndb_number_of_storage_nodes= 0; static long ndb_number_of_data_nodes= 0;
static int update_status_variables(Ndb_cluster_connection *c) static int update_status_variables(Ndb_cluster_connection *c)
{ {
...@@ -155,7 +155,7 @@ static int update_status_variables(Ndb_cluster_connection *c) ...@@ -155,7 +155,7 @@ static int update_status_variables(Ndb_cluster_connection *c)
ndb_connected_port= c->get_connected_port(); ndb_connected_port= c->get_connected_port();
ndb_connected_host= c->get_connected_host(); ndb_connected_host= c->get_connected_host();
ndb_number_of_replicas= 0; ndb_number_of_replicas= 0;
ndb_number_of_storage_nodes= c->no_db_nodes(); ndb_number_of_data_nodes= c->no_db_nodes();
return 0; return 0;
} }
...@@ -164,7 +164,7 @@ struct show_var_st ndb_status_variables[]= { ...@@ -164,7 +164,7 @@ struct show_var_st ndb_status_variables[]= {
{"config_from_host", (char*) &ndb_connected_host, SHOW_CHAR_PTR}, {"config_from_host", (char*) &ndb_connected_host, SHOW_CHAR_PTR},
{"config_from_port", (char*) &ndb_connected_port, SHOW_LONG}, {"config_from_port", (char*) &ndb_connected_port, SHOW_LONG},
// {"number_of_replicas", (char*) &ndb_number_of_replicas, SHOW_LONG}, // {"number_of_replicas", (char*) &ndb_number_of_replicas, SHOW_LONG},
{"number_of_storage_nodes",(char*) &ndb_number_of_storage_nodes, SHOW_LONG}, {"number_of_data_nodes",(char*) &ndb_number_of_data_nodes, SHOW_LONG},
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment