diff options
author | unknown <joreland@mysql.com> | 2004-12-29 16:01:43 +0100 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2004-12-29 16:01:43 +0100 |
commit | d31dd70b5a99eb5268a065a8913a089639618401 (patch) | |
tree | 7b14a398656749dc0b62fbd40f965969b8b8ed82 | |
parent | 821e062b270995f9d15793843eeb574a76d97777 (diff) | |
download | mariadb-git-d31dd70b5a99eb5268a065a8913a089639618401.tar.gz |
ndb - Update test programs to use new Ndb constructor
ndb/test/include/NDBT_Test.hpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/Bank.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/Bank.hpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/bankCreator.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/bankMakeGL.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/bankSumAccounts.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/bankTimer.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/bankTransactionMaker.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/bankValidateAllGLs.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/bank/testBank.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/create_all_tabs.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/create_tab.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/drop_all_tabs.cpp:
Update to use new Ndb constructor
ndb/test/ndbapi/flexBench.cpp:
Update to use new Ndb constructor
ndb/test/src/NDBT_Test.cpp:
Update to use new Ndb constructor
ndb/test/tools/copy_tab.cpp:
Update to use new Ndb constructor
ndb/test/tools/create_index.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoFill.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoLoad.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoLockRecords.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoPkDelete.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoPkRead.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoPkReadRecord.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoPkUpdate.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoScanRead.cpp:
Update to use new Ndb constructor
ndb/test/tools/hugoScanUpdate.cpp:
Update to use new Ndb constructor
ndb/test/tools/verify_index.cpp:
Update to use new Ndb constructor
27 files changed, 195 insertions, 60 deletions
diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index 8b69faebde8..53f75db723f 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -25,6 +25,7 @@ #include <NdbCondition.h> #include <NdbTimer.hpp> #include <Vector.hpp> +#include <NdbApi.hpp> #include <NdbDictionary.hpp> class NDBT_Step; @@ -34,7 +35,9 @@ class NDBT_TestCaseImpl1; class NDBT_Context { public: - NDBT_Context(); + Ndb_cluster_connection& m_cluster_connection; + + NDBT_Context(Ndb_cluster_connection&); ~NDBT_Context(); const NdbDictionary::Table* getTab(); NDBT_TestSuite* getSuite(); @@ -120,7 +123,7 @@ public: NDBT_TESTFUNC* pfunc); virtual ~NDBT_Step() {} int execute(NDBT_Context*); - virtual int setUp() = 0; + virtual int setUp(Ndb_cluster_connection&) = 0; virtual void tearDown() = 0; void setContext(NDBT_Context*); NDBT_Context* getContext(); @@ -142,7 +145,7 @@ public: const char* pname, NDBT_TESTFUNC* pfunc); virtual ~NDBT_NdbApiStep() {} - virtual int setUp(); + virtual int setUp(Ndb_cluster_connection&); virtual void tearDown(); Ndb* getNdb(); @@ -347,10 +350,13 @@ public: int addTest(NDBT_TestCase* pTest); private: - int executeOne(const char* _tabname, const char* testname = NULL); - int executeAll(const char* testname = NULL); - - void execute(Ndb*, const NdbDictionary::Table*, const char* testname = NULL); + int executeOne(Ndb_cluster_connection&, + const char* _tabname, const char* testname = NULL); + int executeAll(Ndb_cluster_connection&, + const char* testname = NULL); + void execute(Ndb_cluster_connection&, + Ndb*, const NdbDictionary::Table*, const char* testname = NULL); + int report(const char* _tcname = NULL); int reportAllTables(const char* ); const char* name; diff --git a/ndb/test/ndbapi/bank/Bank.cpp b/ndb/test/ndbapi/bank/Bank.cpp index e631883f50e..40819ecc849 100644 --- a/ndb/test/ndbapi/bank/Bank.cpp +++ b/ndb/test/ndbapi/bank/Bank.cpp @@ -19,8 +19,8 @@ #include <NdbSleep.h> #include <UtilTransactions.hpp> -Bank::Bank(): - m_ndb("BANK"), +Bank::Bank(Ndb_cluster_connection& con): + m_ndb(&con, "BANK"), m_maxAccount(-1), m_initialized(false) { diff --git a/ndb/test/ndbapi/bank/Bank.hpp b/ndb/test/ndbapi/bank/Bank.hpp index 34c5ff51cc2..d9dd7b25944 100644 --- a/ndb/test/ndbapi/bank/Bank.hpp +++ b/ndb/test/ndbapi/bank/Bank.hpp @@ -27,7 +27,7 @@ class Bank { public: - Bank(); + Bank(Ndb_cluster_connection&); int createAndLoadBank(bool overWrite, int num_accounts=10); int dropBank(); diff --git a/ndb/test/ndbapi/bank/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator.cpp index 301d8bda6d2..257255babc8 100644 --- a/ndb/test/ndbapi/bank/bankCreator.cpp +++ b/ndb/test/ndbapi/bank/bankCreator.cpp @@ -43,7 +43,13 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } - Bank bank; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Bank bank(con); int overWriteExisting = true; if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK) return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/ndbapi/bank/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL.cpp index 9e2762ed8ae..cf373481e3e 100644 --- a/ndb/test/ndbapi/bank/bankMakeGL.cpp +++ b/ndb/test/ndbapi/bank/bankMakeGL.cpp @@ -43,7 +43,13 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } - Bank bank; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Bank bank(con); if (bank.performMakeGLs() != 0) return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/ndbapi/bank/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts.cpp index b576161b27b..034f70f8f95 100644 --- a/ndb/test/ndbapi/bank/bankSumAccounts.cpp +++ b/ndb/test/ndbapi/bank/bankSumAccounts.cpp @@ -43,7 +43,13 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } - Bank bank; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Bank bank(con); if (bank.performSumAccounts() != 0) return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/ndbapi/bank/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer.cpp index 874afd9c21e..298f85e1e43 100644 --- a/ndb/test/ndbapi/bank/bankTimer.cpp +++ b/ndb/test/ndbapi/bank/bankTimer.cpp @@ -46,7 +46,13 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } - Bank bank; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Bank bank(con); if (bank.performIncreaseTime(_wait) != 0) return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker.cpp index e5ff9aeb918..f8e646b6553 100644 --- a/ndb/test/ndbapi/bank/bankTransactionMaker.cpp +++ b/ndb/test/ndbapi/bank/bankTransactionMaker.cpp @@ -46,7 +46,13 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } - Bank bank; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Bank bank(con); if (bank.performTransactions(_wait) != 0) return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp index cf298ecc8e3..0c268121d8a 100644 --- a/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp +++ b/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp @@ -44,7 +44,13 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } - Bank bank; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Bank bank(con); if (bank.performValidateAllGLs() != 0) return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/ndbapi/bank/testBank.cpp b/ndb/test/ndbapi/bank/testBank.cpp index 3ef2799cd3c..6be66d528b1 100644 --- a/ndb/test/ndbapi/bank/testBank.cpp +++ b/ndb/test/ndbapi/bank/testBank.cpp @@ -32,7 +32,7 @@ #include "Bank.hpp" int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){ - Bank bank; + Bank bank(ctx->m_cluster_connection); int overWriteExisting = true; if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK) return NDBT_FAILED; @@ -40,7 +40,7 @@ int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){ } int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){ - Bank bank; + Bank bank(ctx->m_cluster_connection); int wait = 30; // Max seconds between each "day" int yield = 1; // Loops before bank returns @@ -51,7 +51,7 @@ int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){ } int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){ - Bank bank; + Bank bank(ctx->m_cluster_connection); int wait = 10; // Max ms between each transaction int yield = 100; // Loops before bank returns @@ -62,7 +62,7 @@ int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){ } int runBankGL(NDBT_Context* ctx, NDBT_Step* step){ - Bank bank; + Bank bank(ctx->m_cluster_connection); int yield = 20; // Loops before bank returns int result = NDBT_OK; @@ -76,7 +76,7 @@ int runBankGL(NDBT_Context* ctx, NDBT_Step* step){ } int runBankSum(NDBT_Context* ctx, NDBT_Step* step){ - Bank bank; + Bank bank(ctx->m_cluster_connection); int wait = 2000; // Max ms between each sum of accounts int yield = 1; // Loops before bank returns int result = NDBT_OK; @@ -91,7 +91,7 @@ int runBankSum(NDBT_Context* ctx, NDBT_Step* step){ } int runDropBank(NDBT_Context* ctx, NDBT_Step* step){ - Bank bank; + Bank bank(ctx->m_cluster_connection); if (bank.dropBank() != NDBT_OK) return NDBT_FAILED; return NDBT_OK; diff --git a/ndb/test/ndbapi/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs.cpp index 97236b98b36..f06078d67a2 100644 --- a/ndb/test/ndbapi/create_all_tabs.cpp +++ b/ndb/test/ndbapi/create_all_tabs.cpp @@ -47,7 +47,12 @@ int main(int argc, const char** argv){ } // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/ndbapi/create_tab.cpp b/ndb/test/ndbapi/create_tab.cpp index f3f18982ed0..b35c8655236 100644 --- a/ndb/test/ndbapi/create_tab.cpp +++ b/ndb/test/ndbapi/create_tab.cpp @@ -77,8 +77,12 @@ int main(int argc, const char** argv){ */ // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); - MyNdb.setConnectString(_connectstr); + Ndb_cluster_connection con(_connectstr); + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/ndbapi/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs.cpp index c024a81a5e6..f12d750916e 100644 --- a/ndb/test/ndbapi/drop_all_tabs.cpp +++ b/ndb/test/ndbapi/drop_all_tabs.cpp @@ -40,7 +40,13 @@ int main(int argc, const char** argv){ } // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/ndbapi/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp index 2a2388109a1..71ceb468a63 100644 --- a/ndb/test/ndbapi/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench.cpp @@ -279,6 +279,8 @@ tellThreads(ThreadData* pt, StartType what) pt[i].threadStart = what; } +static Ndb_cluster_connection *g_cluster_connection= 0; + NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535) { ndb_init(); @@ -326,8 +328,16 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535) NdbThread_SetConcurrencyLevel(tNoOfThreads + 2); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + g_cluster_connection= &con; + Ndb* pNdb; - pNdb = new Ndb( "TEST_DB" ); + pNdb = new Ndb(&con, "TEST_DB" ); pNdb->init(); tNodeId = pNdb->getNodeId(); @@ -605,7 +615,7 @@ static void* flexBenchThread(void* pArg) attrValue = (int*)malloc(nReadBuffSize) ; attrRefValue = (int*)malloc(nRefBuffSize) ; pOps = (NdbOperation**)malloc(tNoOfTables*sizeof(NdbOperation*)) ; - pNdb = new Ndb( "TEST_DB" ); + pNdb = new Ndb(g_cluster_connection, "TEST_DB" ); if(!attrValue || !attrRefValue || !pOps || !pNdb){ // Check allocations to make sure we got all the memory we asked for diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index bbbde008938..d86cfbf3c70 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -26,7 +26,9 @@ // No verbose outxput -NDBT_Context::NDBT_Context(){ +NDBT_Context::NDBT_Context(Ndb_cluster_connection& con) + : m_cluster_connection(con) +{ tab = NULL; suite = NULL; testcase = NULL; @@ -239,7 +241,7 @@ int NDBT_Step::execute(NDBT_Context* ctx) { g_info << " |- " << name << " started [" << ctx->suite->getDate() << "]" << endl; - result = setUp(); + result = setUp(ctx->m_cluster_connection); if (result != NDBT_OK){ return result; } @@ -279,10 +281,10 @@ NDBT_NdbApiStep::NDBT_NdbApiStep(NDBT_TestCase* ptest, int -NDBT_NdbApiStep::setUp(){ - ndb = new Ndb( "TEST_DB" ); +NDBT_NdbApiStep::setUp(Ndb_cluster_connection& con){ + ndb = new Ndb(&con, "TEST_DB" ); ndb->init(1024); - + int result = ndb->waitUntilReady(300); // 5 minutes if (result != 0){ g_err << name << ": Ndb was not ready" << endl; @@ -745,14 +747,15 @@ int NDBT_TestSuite::addTest(NDBT_TestCase* pTest){ return 0; } -int NDBT_TestSuite::executeAll(const char* _testname){ +int NDBT_TestSuite::executeAll(Ndb_cluster_connection& con, + const char* _testname){ if(tests.size() == 0) return NDBT_FAILED; - Ndb ndb("TEST_DB"); + Ndb ndb(&con, "TEST_DB"); ndb.init(1024); - int result = ndb.waitUntilReady(300); // 5 minutes + int result = ndb.waitUntilReady(500); // 5 minutes if (result != 0){ g_err << name <<": Ndb was not ready" << endl; return NDBT_FAILED; @@ -765,18 +768,19 @@ int NDBT_TestSuite::executeAll(const char* _testname){ for (int t=0; t < NDBT_Tables::getNumTables(); t++){ const NdbDictionary::Table* ptab = NDBT_Tables::getTable(t); ndbout << "|- " << ptab->getName() << endl; - execute(&ndb, ptab, _testname); + execute(con, &ndb, ptab, _testname); } testSuiteTimer.doStop(); return reportAllTables(_testname); } int -NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){ +NDBT_TestSuite::executeOne(Ndb_cluster_connection& con, + const char* _tabname, const char* _testname){ if(tests.size() == 0) return NDBT_FAILED; - Ndb ndb("TEST_DB"); + Ndb ndb(&con, "TEST_DB"); ndb.init(1024); int result = ndb.waitUntilReady(300); // 5 minutes @@ -793,7 +797,7 @@ NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){ ndbout << "|- " << ptab->getName() << endl; - execute(&ndb, ptab, _testname); + execute(con, &ndb, ptab, _testname); if (numTestsFail > 0){ return NDBT_FAILED; @@ -802,7 +806,8 @@ NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){ } } -void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab, +void NDBT_TestSuite::execute(Ndb_cluster_connection& con, + Ndb* ndb, const NdbDictionary::Table* pTab, const char* _testname){ int result; @@ -844,14 +849,14 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab, pTab2 = pTab; } - ctx = new NDBT_Context(); + ctx = new NDBT_Context(con); ctx->setTab(pTab2); ctx->setNumRecords(records); ctx->setNumLoops(loops); if(remote_mgm != NULL) ctx->setRemoteMgm(remote_mgm); ctx->setSuite(this); - + result = tests[t]->execute(ctx); tests[t]->saveTestResult(pTab, result); if (result != NDBT_OK) @@ -1023,14 +1028,19 @@ int NDBT_TestSuite::execute(int argc, const char** argv){ loops = _loops; timer = _timer; + Ndb_cluster_connection con; + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + if(optind == argc){ // No table specified - res = executeAll(_testname); + res = executeAll(con, _testname); } else { testSuiteTimer.doStart(); - Ndb ndb("TEST_DB"); ndb.init(); for(int i = optind; i<argc; i++){ - executeOne(argv[i], _testname); + executeOne(con, argv[i], _testname); } testSuiteTimer.doStop(); res = report(_testname); diff --git a/ndb/test/tools/copy_tab.cpp b/ndb/test/tools/copy_tab.cpp index 30141acaa78..97370b170ef 100644 --- a/ndb/test/tools/copy_tab.cpp +++ b/ndb/test/tools/copy_tab.cpp @@ -56,9 +56,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; _to_tabname = argv[optind+1]; - if (_connectstr) - Ndb::setConnectString(_connectstr); - Ndb MyNdb(_dbname); + Ndb_cluster_connection con(_connectstr); + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con,_dbname); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/tools/create_index.cpp b/ndb/test/tools/create_index.cpp index 6e4c5377f4a..9f9c26aa0da 100644 --- a/ndb/test/tools/create_index.cpp +++ b/ndb/test/tools/create_index.cpp @@ -53,8 +53,13 @@ main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_WRONGARGS); } + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } - Ndb MyNdb(_dbname); + Ndb MyNdb(&con, _dbname); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/test/tools/hugoFill.cpp b/ndb/test/tools/hugoFill.cpp index 6253bd1bb12..6408b2987f9 100644 --- a/ndb/test/tools/hugoFill.cpp +++ b/ndb/test/tools/hugoFill.cpp @@ -51,7 +51,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoLoad.cpp b/ndb/test/tools/hugoLoad.cpp index c697ad22aad..7d9d0dafaff 100644 --- a/ndb/test/tools/hugoLoad.cpp +++ b/ndb/test/tools/hugoLoad.cpp @@ -54,7 +54,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords.cpp index 629408d401d..c0d0b9f9c5a 100644 --- a/ndb/test/tools/hugoLockRecords.cpp +++ b/ndb/test/tools/hugoLockRecords.cpp @@ -59,7 +59,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoPkDelete.cpp b/ndb/test/tools/hugoPkDelete.cpp index 78a90ebcb46..84e7ded0add 100644 --- a/ndb/test/tools/hugoPkDelete.cpp +++ b/ndb/test/tools/hugoPkDelete.cpp @@ -55,7 +55,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead.cpp index cf08b137e8e..e3702dc5ca1 100644 --- a/ndb/test/tools/hugoPkRead.cpp +++ b/ndb/test/tools/hugoPkRead.cpp @@ -60,7 +60,12 @@ int main(int argc, const char** argv){ // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord.cpp index 38b7cae2bf4..c60a994c7d4 100644 --- a/ndb/test/tools/hugoPkReadRecord.cpp +++ b/ndb/test/tools/hugoPkReadRecord.cpp @@ -62,7 +62,12 @@ int main(int argc, const char** argv) << "Row: " << _row << ", PrimaryKey: " << _primaryKey << endl; - Ndb* ndb = new Ndb("TEST_DB"); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb* ndb = new Ndb(&con, "TEST_DB"); if (ndb->init() == 0 && ndb->waitUntilReady(30) == 0) { NdbConnection* conn = ndb->startTransaction(); diff --git a/ndb/test/tools/hugoPkUpdate.cpp b/ndb/test/tools/hugoPkUpdate.cpp index 286be14a01c..6e7ff39f903 100644 --- a/ndb/test/tools/hugoPkUpdate.cpp +++ b/ndb/test/tools/hugoPkUpdate.cpp @@ -57,7 +57,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead.cpp index d6cbc00164a..4f76362ecab 100644 --- a/ndb/test/tools/hugoScanRead.cpp +++ b/ndb/test/tools/hugoScanRead.cpp @@ -61,7 +61,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/hugoScanUpdate.cpp b/ndb/test/tools/hugoScanUpdate.cpp index 96a487a02bf..88c343f8fd3 100644 --- a/ndb/test/tools/hugoScanUpdate.cpp +++ b/ndb/test/tools/hugoScanUpdate.cpp @@ -58,7 +58,12 @@ int main(int argc, const char** argv){ _tabname = argv[optind]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); diff --git a/ndb/test/tools/verify_index.cpp b/ndb/test/tools/verify_index.cpp index 6c8e304e1a1..acc97af883b 100644 --- a/ndb/test/tools/verify_index.cpp +++ b/ndb/test/tools/verify_index.cpp @@ -53,7 +53,12 @@ int main(int argc, const char** argv){ _indexname = argv[optind+1]; // Connect to Ndb - Ndb MyNdb( "TEST_DB" ); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb MyNdb(&con, "TEST_DB" ); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); |