Commit 91a04d18 authored by joreland@mysql.com's avatar joreland@mysql.com

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

into mysql.com:/home/jonas/src/mysql-5.0-ndb
parents d737ba98 5de6bf24
...@@ -66,10 +66,15 @@ main(int argc, char** argv){ ...@@ -66,10 +66,15 @@ main(int argc, char** argv){
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
return NDBT_ProgramExit(NDBT_WRONGARGS); 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; Ndb* pNdb;
pNdb = new Ndb(_dbname); pNdb = new Ndb(&con, _dbname);
pNdb->init(); pNdb->init();
while (pNdb->waitUntilReady() != 0); while (pNdb->waitUntilReady() != 0);
int res = NDBT_FAILED; int res = NDBT_FAILED;
......
...@@ -209,7 +209,7 @@ makeOff(int k) ...@@ -209,7 +209,7 @@ makeOff(int k)
} }
static int static int
testcase(int flag) testcase(Ndb_cluster_connection&cc, int flag)
{ {
ndbout << "--- case " << flag << " ---" << endl; ndbout << "--- case " << flag << " ---" << endl;
sprintf(tab, "TB%02d", flag); sprintf(tab, "TB%02d", flag);
...@@ -254,7 +254,7 @@ testcase(int flag) ...@@ -254,7 +254,7 @@ testcase(int flag)
ndbout << "tab=" << tab << " cols=" << attrcnt ndbout << "tab=" << tab << " cols=" << attrcnt
<< " size max=" << smax << " tot=" << stot << endl; << " size max=" << smax << " tot=" << stot << endl;
ndb = new Ndb("TEST_DB"); ndb = new Ndb(&cc, "TEST_DB");
if (ndb->init() != 0) if (ndb->init() != 0)
return ndberror("init"); return ndberror("init");
if (ndb->waitUntilReady(30) < 0) if (ndb->waitUntilReady(30) < 0)
...@@ -606,10 +606,17 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff ...@@ -606,10 +606,17 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff
} }
} }
unsigned ok = true; 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++) { for (i = 1; 0 == loopcnt || i <= loopcnt; i++) {
ndbout << "=== loop " << i << " ===" << endl; ndbout << "=== loop " << i << " ===" << endl;
for (int flag = 0; flag < (1<<testbits); flag++) { for (int flag = 0; flag < (1<<testbits); flag++) {
if (testcase(flag) < 0) { if (testcase(con, flag) < 0) {
ok = false; ok = false;
if (! kontinue) if (! kontinue)
goto out; goto out;
......
...@@ -56,7 +56,7 @@ int runTestMaxNdb(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -56,7 +56,7 @@ int runTestMaxNdb(NDBT_Context* ctx, NDBT_Step* step){
int init = 0; int init = 0;
do { do {
Ndb* pNdb = new Ndb("TEST_DB"); Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
if (pNdb == NULL){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
errors++; errors++;
...@@ -108,7 +108,7 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -108,7 +108,7 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){
int oldi = 0; int oldi = 0;
int result = NDBT_OK; int result = NDBT_OK;
Ndb* pNdb = new Ndb("TEST_DB"); Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
if (pNdb == NULL){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -201,7 +201,7 @@ int runTestMaxOperations(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -201,7 +201,7 @@ int runTestMaxOperations(NDBT_Context* ctx, NDBT_Step* step){
int maxOpsLimit = 1; int maxOpsLimit = 1;
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -273,7 +273,7 @@ int runTestGetValue(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -273,7 +273,7 @@ int runTestGetValue(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK; int result = NDBT_OK;
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -373,7 +373,7 @@ int runTestEqual(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -373,7 +373,7 @@ int runTestEqual(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK; int result = NDBT_OK;
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -494,7 +494,7 @@ int runTestDeleteNdb(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -494,7 +494,7 @@ int runTestDeleteNdb(NDBT_Context* ctx, NDBT_Step* step){
// Create 5 ndb objects // Create 5 ndb objects
for( int i = 0; i < 5; i++){ 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
result = NDBT_FAILED; result = NDBT_FAILED;
...@@ -575,7 +575,7 @@ int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -575,7 +575,7 @@ int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){
int runTestWaitUntilReady(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(); // Forget about calling pNdb->init();
...@@ -596,7 +596,7 @@ int runTestWaitUntilReady(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -596,7 +596,7 @@ int runTestWaitUntilReady(NDBT_Context* ctx, NDBT_Step* step){
int runGetNdbOperationNoTab(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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -637,7 +637,7 @@ int runMissingOperation(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -637,7 +637,7 @@ int runMissingOperation(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -687,7 +687,7 @@ int runMissingOperation(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -687,7 +687,7 @@ int runMissingOperation(NDBT_Context* ctx, NDBT_Step* step){
int runGetValueInUpdate(NDBT_Context* ctx, NDBT_Step* step){ int runGetValueInUpdate(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -753,7 +753,7 @@ int runUpdateWithoutValues(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -753,7 +753,7 @@ int runUpdateWithoutValues(NDBT_Context* ctx, NDBT_Step* step){
HugoOperations hugoOps(*pTab); HugoOperations hugoOps(*pTab);
Ndb* pNdb = new Ndb("TEST_DB"); Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
if (pNdb == NULL){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -819,7 +819,7 @@ int runUpdateWithoutKeys(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -819,7 +819,7 @@ int runUpdateWithoutKeys(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -873,7 +873,7 @@ int runCheckGetNdbErrorOperation(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -873,7 +873,7 @@ int runCheckGetNdbErrorOperation(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK; int result = NDBT_OK;
const NdbDictionary::Table* pTab = ctx->getTab(); 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){ if (pNdb == NULL){
ndbout << "pNdb == NULL" << endl; ndbout << "pNdb == NULL" << endl;
return NDBT_FAILED; return NDBT_FAILED;
......
...@@ -119,7 +119,13 @@ main(int argc, const char** argv){ ...@@ -119,7 +119,13 @@ main(int argc, const char** argv){
myRandom48Init(NdbTick_CurrentMillisecond()); myRandom48Init(NdbTick_CurrentMillisecond());
memset(g_times, 0, sizeof(g_times)); 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){ if(g_ndb->init() != 0){
g_err << "init() failed" << endl; g_err << "init() failed" << endl;
goto error; goto error;
......
...@@ -99,7 +99,13 @@ main(int argc, const char** argv){ ...@@ -99,7 +99,13 @@ main(int argc, const char** argv){
myRandom48Init(NdbTick_CurrentMillisecond()); 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){ if(g_ndb->init() != 0){
g_err << "init() failed" << endl; g_err << "init() failed" << endl;
goto error; goto error;
......
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