summaryrefslogtreecommitdiff
path: root/storage/ndb/test
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-10-19 11:20:04 +0200
committerunknown <jonas@perch.ndb.mysql.com>2006-10-19 11:20:04 +0200
commitb8812c85db4bb6d16e99c0ee93dd21bc6e1b64bb (patch)
tree7f792adc455f513e4d80635ba416504cf753bfd7 /storage/ndb/test
parente4a398f1d355dea04621ad992d46ef02313da56f (diff)
downloadmariadb-git-b8812c85db4bb6d16e99c0ee93dd21bc6e1b64bb.tar.gz
ndb - add temporary tables to hugo
and use it for testOperations/testTransactions storage/ndb/test/include/NDBT_Test.hpp: Add support for temporary tables in hugo storage/ndb/test/ndbapi/testOperations.cpp: Make testOperations use temporary tables storage/ndb/test/ndbapi/testTransactions.cpp: Make testTransactions use temporary tables storage/ndb/test/src/NDBT_Tables.cpp: Add support for temporary tables in hugo storage/ndb/test/src/NDBT_Test.cpp: Add support for temporary tables in hugo
Diffstat (limited to 'storage/ndb/test')
-rw-r--r--storage/ndb/test/include/NDBT_Test.hpp4
-rw-r--r--storage/ndb/test/ndbapi/testOperations.cpp6
-rw-r--r--storage/ndb/test/ndbapi/testTransactions.cpp2
-rw-r--r--storage/ndb/test/src/NDBT_Tables.cpp5
-rw-r--r--storage/ndb/test/src/NDBT_Test.cpp25
5 files changed, 37 insertions, 5 deletions
diff --git a/storage/ndb/test/include/NDBT_Test.hpp b/storage/ndb/test/include/NDBT_Test.hpp
index a22aa6e53bf..8c3c22192fc 100644
--- a/storage/ndb/test/include/NDBT_Test.hpp
+++ b/storage/ndb/test/include/NDBT_Test.hpp
@@ -364,6 +364,9 @@ public:
// Table create tweaks
int createHook(Ndb*, NdbDictionary::Table&, int when);
Vector<BaseString> m_tables_in_test;
+
+ void setTemporaryTables(bool val);
+ bool getTemporaryTables() const;
private:
int executeOne(Ndb_cluster_connection&,
const char* _tabname, const char* testname = NULL);
@@ -390,6 +393,7 @@ private:
bool runonce;
const char* tsname;
bool createAllTables;
+ bool temporaryTables;
};
diff --git a/storage/ndb/test/ndbapi/testOperations.cpp b/storage/ndb/test/ndbapi/testOperations.cpp
index e116545f7e3..5e629f8c0c9 100644
--- a/storage/ndb/test/ndbapi/testOperations.cpp
+++ b/storage/ndb/test/ndbapi/testOperations.cpp
@@ -660,9 +660,11 @@ main(int argc, const char** argv){
Vector<int> tmp;
generate(tmp, 5);
-
+
NDBT_TestSuite ts("testOperations");
-
+
+ ts.setTemporaryTables(true);
+
for(Uint32 i = 0; i < 12; i++)
{
if(false && (i == 6 || i == 8 || i == 10))
diff --git a/storage/ndb/test/ndbapi/testTransactions.cpp b/storage/ndb/test/ndbapi/testTransactions.cpp
index 3de088a5818..8552d1df6fb 100644
--- a/storage/ndb/test/ndbapi/testTransactions.cpp
+++ b/storage/ndb/test/ndbapi/testTransactions.cpp
@@ -372,6 +372,8 @@ main(int argc, const char** argv){
ndb_init();
NDBT_TestSuite ts("testOperations");
+ ts.setTemporaryTables(true);
+
for(Uint32 i = 0; i<sizeof(matrix)/sizeof(matrix[0]); i++){
NDBT_TestCaseImpl1 *pt = new NDBT_TestCaseImpl1(&ts, matrix[i].name, "");
diff --git a/storage/ndb/test/src/NDBT_Tables.cpp b/storage/ndb/test/src/NDBT_Tables.cpp
index 520892f17da..3223edd351f 100644
--- a/storage/ndb/test/src/NDBT_Tables.cpp
+++ b/storage/ndb/test/src/NDBT_Tables.cpp
@@ -1039,6 +1039,11 @@ loop:
j++;
}
j++;
+ if (tmpTab.getTemporary())
+ {
+ tmpIndx.setTemporary(true);
+ tmpIndx.setLogging(false);
+ }
if(pNdb->getDictionary()->createIndex(tmpIndx) != 0){
ndbout << pNdb->getDictionary()->getNdbError() << endl;
return NDBT_FAILED;
diff --git a/storage/ndb/test/src/NDBT_Test.cpp b/storage/ndb/test/src/NDBT_Test.cpp
index 5bec0607255..37d1fa09691 100644
--- a/storage/ndb/test/src/NDBT_Test.cpp
+++ b/storage/ndb/test/src/NDBT_Test.cpp
@@ -770,6 +770,7 @@ NDBT_TestSuite::NDBT_TestSuite(const char* pname):name(pname){
diskbased = false;
tsname = NULL;
createAllTables = false;
+ temporaryTables = false;
}
@@ -791,6 +792,14 @@ void NDBT_TestSuite::setCreateAllTables(bool _flag){
createAllTables = _flag;
}
+void NDBT_TestSuite::setTemporaryTables(bool val){
+ temporaryTables = val;
+}
+
+bool NDBT_TestSuite::getTemporaryTables() const {
+ return temporaryTables;
+}
+
bool NDBT_TestSuite::timerIsOn(){
return (timer != 0);
}
@@ -805,6 +814,7 @@ static int
g_create_hook(Ndb* ndb, NdbDictionary::Table& tab, int when, void* arg)
{
NDBT_TestSuite* ts = (NDBT_TestSuite*)arg;
+
return ts->createHook(ndb, tab, when);
}
@@ -942,14 +952,23 @@ int
NDBT_TestSuite::createHook(Ndb* ndb, NdbDictionary::Table& tab, int when)
{
if (when == 0) {
- if (diskbased) {
- for (int i = 0; i < tab.getNoOfColumns(); i++) {
+ if (diskbased)
+ {
+ for (int i = 0; i < tab.getNoOfColumns(); i++)
+ {
NdbDictionary::Column* col = tab.getColumn(i);
- if (! col->getPrimaryKey()) {
+ if (! col->getPrimaryKey())
+ {
col->setStorageType(NdbDictionary::Column::StorageTypeDisk);
}
}
}
+ else if (temporaryTables)
+ {
+ tab.setTemporary(true);
+ tab.setLogging(false);
+ }
+
if (tsname != NULL) {
tab.setTablespace(tsname);
}