#At file:///home/tomas/mysql_src/mysql-5.1-telco-6.4/
3181 Tomas Ulin 2008-12-18 [merge]
merge
modified:
storage/ndb/test/run-test/db.cpp
storage/ndb/tools/waiter.cpp
=== modified file 'storage/ndb/test/run-test/db.cpp'
--- a/storage/ndb/test/run-test/db.cpp 2008-12-16 17:12:00 +0000
+++ b/storage/ndb/test/run-test/db.cpp 2008-12-17 22:03:10 +0000
@@ -138,13 +138,18 @@ connect_mysqld(atrt_process* proc)
return false;
}
+ if (port)
+ {
+ mysql_protocol_type val = MYSQL_PROTOCOL_TCP;
+ mysql_options(&proc->m_mysql, MYSQL_OPT_PROTOCOL, &val);
+ }
for (size_t i = 0; i<20; i++)
{
if (mysql_real_connect(&proc->m_mysql,
proc->m_host->m_hostname.c_str(),
"root", "", "test",
port ? atoi(port) : 0,
- port ? 0 : socket,
+ socket,
0))
{
return true;
=== modified file 'storage/ndb/tools/waiter.cpp'
--- a/storage/ndb/tools/waiter.cpp 2008-08-21 14:35:42 +0000
+++ b/storage/ndb/tools/waiter.cpp 2008-12-18 08:51:37 +0000
@@ -25,18 +25,23 @@
#include <NDBT.hpp>
+#include <kernel/NodeBitmask.hpp>
+
static int
waitClusterStatus(const char* _addr, ndb_mgm_node_status _status);
enum ndb_waiter_options {
OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST,
OPT_WAIT_STATUS_SINGLE_USER
+ ,OPT_NOWAIT_NODES
};
static int _no_contact = 0;
static int _not_started = 0;
static int _single_user = 0;
static int _timeout = 120;
+static const char* _nowait_nodes = 0;
+static NdbNodeBitmask nowait_nodes_bitmask;
const char *load_default_groups[]= { "mysql_cluster",0 };
@@ -56,6 +61,10 @@ static struct my_option my_long_options[
{ "timeout", 't', "Timeout to wait in seconds",
(uchar**) &_timeout, (uchar**) &_timeout, 0,
GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 },
+ { "nowait-nodes", OPT_NOWAIT_NODES,
+ "Nodes that will not be waited for",
+ (uchar**) &_nowait_nodes, (uchar**) &_nowait_nodes, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -106,6 +115,23 @@ int main(int argc, char** argv){
wait_status= NDB_MGM_NODE_STATUS_STARTED;
}
+ if (_nowait_nodes)
+ {
+ int res = nowait_nodes_bitmask.parseMask(_nowait_nodes);
+ if(res == -2 || (res > 0 && nowait_nodes_bitmask.get(0)))
+ {
+ ndbout_c("Invalid nodeid specified in nowait-nodes: %s",
+ _nowait_nodes);
+ exit(-1);
+ }
+ else if (res < 0)
+ {
+ ndbout_c("Unable to parse nowait-nodes argument: %s",
+ _nowait_nodes);
+ exit(-1);
+ }
+ }
+
if (waitClusterStatus(_hostName, wait_status) != 0)
return NDBT_ProgramExit(NDBT_FAILED);
return NDBT_ProgramExit(NDBT_OK);
@@ -147,7 +173,8 @@ getStatus(){
node = &status->node_states[i];
switch(node->node_type){
case NDB_MGM_NODE_TYPE_NDB:
- ndbNodes.push_back(*node);
+ if (!nowait_nodes_bitmask.get(node->node_id))
+ ndbNodes.push_back(*node);
break;
case NDB_MGM_NODE_TYPE_MGM:
/* Don't care about MGM nodes */
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (tomas.ulin:3181) | Tomas Ulin | 19 Dec |