From fdedd0fc5b75c98d3fb8a84448e14942309445d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 23 Jan 2005 12:12:50 +0100 Subject: [PATCH 1/3] backported from 5.0 extra option to ndb_waiter --- ndb/tools/waiter.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index 4b86de36514..dfdb11524e3 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); enum ndb_waiter_options { - NDB_STD_OPTS_OPTIONS + NDB_STD_OPTS_OPTIONS, + OPT_WAIT_STATUS_NOT_STARTED }; NDB_STD_OPTS_VARS; static int _no_contact = 0; +static int _not_started = 0; static int _timeout = 120; static struct my_option my_long_options[] = { @@ -43,6 +45,9 @@ static struct my_option my_long_options[] = { "no-contact", 'n', "Wait for cluster no contact", (gptr*) &_no_contact, (gptr*) &_no_contact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started", + (gptr*) &_not_started, (gptr*) &_not_started, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "timeout", 't', "Timeout to wait", (gptr*) &_timeout, (gptr*) &_timeout, 0, GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, @@ -91,12 +96,22 @@ int main(int argc, char** argv){ if (_hostName == 0) _hostName= opt_connect_str; - if (_no_contact) { - if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0) - return NDBT_ProgramExit(NDBT_FAILED); - } else if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_STARTED, _timeout) != 0) - return NDBT_ProgramExit(NDBT_FAILED); + enum ndb_mgm_node_status wait_status; + if (_no_contact) + { + wait_status= NDB_MGM_NODE_STATUS_NO_CONTACT; + } + else if (_not_started) + { + wait_status= NDB_MGM_NODE_STATUS_NOT_STARTED; + } + else + { + wait_status= NDB_MGM_NODE_STATUS_STARTED; + } + if (waitClusterStatus(_hostName, wait_status, _timeout) != 0) + return NDBT_ProgramExit(NDBT_FAILED); return NDBT_ProgramExit(NDBT_OK); } From 2f196ec77177209edc308b715e6fd61b119647ce Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 10:33:39 +0100 Subject: [PATCH 2/3] remmoved inline in NdbRecAttr methods including memcpy --- ndb/include/ndbapi/NdbRecAttr.hpp | 36 ------------------------------- ndb/src/ndbapi/NdbRecAttr.cpp | 32 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 29eab64a84f..05635a99385 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -300,15 +300,6 @@ NdbRecAttr::arraySize() const return theArraySize; } -inline -Int64 -NdbRecAttr::int64_value() const -{ - Int64 val; - memcpy(&val,theRef,8); - return val; -} - inline Int32 NdbRecAttr::int32_value() const @@ -330,15 +321,6 @@ NdbRecAttr::char_value() const return *(char*)theRef; } -inline -Uint64 -NdbRecAttr::u_64_value() const -{ - Uint64 val; - memcpy(&val,theRef,8); - return val; -} - inline Uint32 NdbRecAttr::u_32_value() const @@ -360,24 +342,6 @@ NdbRecAttr::u_char_value() const return *(Uint8*)theRef; } -inline -float -NdbRecAttr::float_value() const -{ - float val; - memcpy(&val,theRef,sizeof(val)); - return val; -} - -inline -double -NdbRecAttr::double_value() const -{ - double val; - memcpy(&val,theRef,sizeof(val)); - return val; -} - inline void NdbRecAttr::release() diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index bcd91292fcd..f2427fb32e8 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -245,3 +245,35 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) return out; } + +Int64 +NdbRecAttr::int64_value() const +{ + Int64 val; + memcpy(&val,theRef,8); + return val; +} + +Uint64 +NdbRecAttr::u_64_value() const +{ + Uint64 val; + memcpy(&val,theRef,8); + return val; +} + +float +NdbRecAttr::float_value() const +{ + float val; + memcpy(&val,theRef,sizeof(val)); + return val; +} + +double +NdbRecAttr::double_value() const +{ + double val; + memcpy(&val,theRef,sizeof(val)); + return val; +} From 343e9bbd34ecd89deb7d28214e23171894b8b2a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 10:47:51 +0100 Subject: [PATCH 3/3] mysql-test-run.sh: backported access to ndb_mgm from 5.0 mysql-test/mysql-test-run.sh: backported access to ndb_mgm from 5.0 --- mysql-test/mysql-test-run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 722da516d9b..5c4fe0577a2 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -537,6 +537,7 @@ if [ x$SOURCE_DIST = x1 ] ; then INSTALL_DB="./install_test_db" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$BASEDIR/ndb/tools" + NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm" else if test -x "$BASEDIR/libexec/mysqld" then @@ -558,6 +559,7 @@ else INSTALL_DB="./install_test_db --bin" MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$CLIENT_BINDIR" + NDB_MGM="$CLIENT_BINDIR/ndb_mgm" if test -d "$BASEDIR/share/mysql/english" then LANGUAGE="$BASEDIR/share/mysql/english/" @@ -607,6 +609,7 @@ MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --u export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR export NDB_TOOLS_DIR +export NDB_MGM MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \