diff --git a/ndb/test/ndbapi/testBitfield.cpp b/ndb/test/ndbapi/testBitfield.cpp index 42439e20959..580fe161c08 100644 --- a/ndb/test/ndbapi/testBitfield.cpp +++ b/ndb/test/ndbapi/testBitfield.cpp @@ -66,10 +66,15 @@ main(int argc, char** argv){ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); - Ndb::setConnectString(opt_connect_str); + Ndb_cluster_connection con(opt_connect_str); + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + Ndb* pNdb; - pNdb = new Ndb(_dbname); + pNdb = new Ndb(&con, _dbname); pNdb->init(); while (pNdb->waitUntilReady() != 0); int res = NDBT_FAILED; diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp index 37991a16bd0..aaecb6ee61e 100644 --- a/ndb/test/ndbapi/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers.cpp @@ -209,7 +209,7 @@ makeOff(int k) } static int -testcase(int flag) +testcase(Ndb_cluster_connection&cc, int flag) { ndbout << "--- case " << flag << " ---" << endl; sprintf(tab, "TB%02d", flag); @@ -254,7 +254,7 @@ testcase(int flag) ndbout << "tab=" << tab << " cols=" << attrcnt << " size max=" << smax << " tot=" << stot << endl; - ndb = new Ndb("TEST_DB"); + ndb = new Ndb(&cc, "TEST_DB"); if (ndb->init() != 0) return ndberror("init"); if (ndb->waitUntilReady(30) < 0) @@ -606,10 +606,17 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff } } unsigned ok = true; + + Ndb_cluster_connection con; + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + for (i = 1; 0 == loopcnt || i <= loopcnt; i++) { ndbout << "=== loop " << i << " ===" << endl; for (int flag = 0; flag < (1<m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; errors++; @@ -108,7 +108,7 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ int oldi = 0; int result = NDBT_OK; - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -201,7 +201,7 @@ int runTestMaxOperations(NDBT_Context* ctx, NDBT_Step* step){ int maxOpsLimit = 1; const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -273,7 +273,7 @@ int runTestGetValue(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -373,7 +373,7 @@ int runTestEqual(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -494,7 +494,7 @@ int runTestDeleteNdb(NDBT_Context* ctx, NDBT_Step* step){ // Create 5 ndb objects for( int i = 0; i < 5; i++){ - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; result = NDBT_FAILED; @@ -575,7 +575,7 @@ int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ int runTestWaitUntilReady(NDBT_Context* ctx, NDBT_Step* step){ - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); // Forget about calling pNdb->init(); @@ -596,7 +596,7 @@ int runTestWaitUntilReady(NDBT_Context* ctx, NDBT_Step* step){ int runGetNdbOperationNoTab(NDBT_Context* ctx, NDBT_Step* step){ - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -637,7 +637,7 @@ int runMissingOperation(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -687,7 +687,7 @@ int runMissingOperation(NDBT_Context* ctx, NDBT_Step* step){ int runGetValueInUpdate(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -753,7 +753,7 @@ int runUpdateWithoutValues(NDBT_Context* ctx, NDBT_Step* step){ HugoOperations hugoOps(*pTab); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -819,7 +819,7 @@ int runUpdateWithoutKeys(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; @@ -873,7 +873,7 @@ int runCheckGetNdbErrorOperation(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; const NdbDictionary::Table* pTab = ctx->getTab(); - Ndb* pNdb = new Ndb("TEST_DB"); + Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index ec4018c6204..ba5f3c4232d 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -119,7 +119,13 @@ main(int argc, const char** argv){ myRandom48Init(NdbTick_CurrentMillisecond()); memset(g_times, 0, sizeof(g_times)); - g_ndb = new Ndb("TEST_DB"); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + g_ndb = new Ndb(&con, "TEST_DB"); if(g_ndb->init() != 0){ g_err << "init() failed" << endl; goto error; diff --git a/ndb/test/ndbapi/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf.cpp index 6669338ad41..8ac81297ac3 100644 --- a/ndb/test/ndbapi/testScanPerf.cpp +++ b/ndb/test/ndbapi/testScanPerf.cpp @@ -99,7 +99,13 @@ main(int argc, const char** argv){ myRandom48Init(NdbTick_CurrentMillisecond()); - g_ndb = new Ndb("TEST_DB"); + Ndb_cluster_connection con; + if(con.connect(12, 5, 1)) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + + g_ndb = new Ndb(&con, "TEST_DB"); if(g_ndb->init() != 0){ g_err << "init() failed" << endl; goto error;