summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-01-04 11:38:58 +0100
committerunknown <jonas@perch.ndb.mysql.com>2006-01-04 11:38:58 +0100
commit522bbb83046e746a524caba646eba7f7e0b3f3d1 (patch)
tree8f9388621d8797c2b7e925e1e83c229440e399fb /ndb
parent887d498b26b863412d310b4827aa2925f2c90329 (diff)
downloadmariadb-git-522bbb83046e746a524caba646eba7f7e0b3f3d1.tar.gz
ndb - Make testDatabuffer clean up tables
ndb/test/ndbapi/testDataBuffers.cpp: Make testDatabuffer clean up tables
Diffstat (limited to 'ndb')
-rw-r--r--ndb/test/ndbapi/testDataBuffers.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp
index 03d52252334..27e241fa87a 100644
--- a/ndb/test/ndbapi/testDataBuffers.cpp
+++ b/ndb/test/ndbapi/testDataBuffers.cpp
@@ -254,12 +254,6 @@ testcase(int flag)
ndbout << "tab=" << tab << " cols=" << attrcnt
<< " size max=" << smax << " tot=" << stot << endl;
- ndb = new Ndb("TEST_DB");
- if (ndb->init() != 0)
- return ndberror("init");
- if (ndb->waitUntilReady(30) < 0)
- return ndberror("waitUntilReady");
-
if ((tcon = NdbSchemaCon::startSchemaTrans(ndb)) == 0)
return ndberror("startSchemaTransaction");
if ((top = tcon->getNdbSchemaOp()) == 0)
@@ -541,7 +535,6 @@ testcase(int flag)
return ndberror("key %d not found", k);
ndbout << "scanned " << key << endl;
- ndb = 0;
ndbout << "done" << endl;
return 0;
}
@@ -605,7 +598,23 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
}
+
unsigned ok = true;
+
+ ndb = new Ndb("TEST_DB");
+ if (ndb->init() != 0)
+ {
+ ndberror("init");
+ ok = false;
+ goto out;
+ }
+ if (ndb->waitUntilReady(30) < 0)
+ {
+ ndberror("waitUntilReady");
+ ok = false;
+ goto out;
+ }
+
for (i = 1; 0 == loopcnt || i <= loopcnt; i++) {
ndbout << "=== loop " << i << " ===" << endl;
for (int flag = 0; flag < (1<<testbits); flag++) {
@@ -614,9 +623,13 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff
if (! kontinue)
goto out;
}
+ NdbDictionary::Dictionary * dict = ndb->getDictionary();
+ dict->dropTable(tab);
}
}
+
out:
+ delete ndb;
return NDBT_ProgramExit(ok ? NDBT_OK : NDBT_FAILED);
}