diff options
Diffstat (limited to 'ndb/test')
-rw-r--r-- | ndb/test/include/NDBT_Tables.hpp | 6 | ||||
-rw-r--r-- | ndb/test/src/HugoOperations.cpp | 5 | ||||
-rw-r--r-- | ndb/test/src/NDBT_Tables.cpp | 17 | ||||
-rw-r--r-- | ndb/test/src/NdbSchemaOp.cpp | 1 |
4 files changed, 17 insertions, 12 deletions
diff --git a/ndb/test/include/NDBT_Tables.hpp b/ndb/test/include/NDBT_Tables.hpp index aa78f7d4e2c..fb0df8aa35b 100644 --- a/ndb/test/include/NDBT_Tables.hpp +++ b/ndb/test/include/NDBT_Tables.hpp @@ -23,11 +23,13 @@ #include <NdbDictionary.hpp> #include <NDBT_Table.hpp> +typedef int (* NDBT_CreateTableHook)(Ndb*, NdbDictionary::Table&, int when); + class NDBT_Tables { public: - + static int createTable(Ndb* pNdb, const char* _name, bool _temp = false, - bool existsOK = false); + bool existsOK = false, NDBT_CreateTableHook = 0); static int createAllTables(Ndb* pNdb, bool _temp, bool existsOK = false); static int createAllTables(Ndb* pNdb); diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp index e8e2d992345..d3da8ae4ba2 100644 --- a/ndb/test/src/HugoOperations.cpp +++ b/ndb/test/src/HugoOperations.cpp @@ -456,11 +456,6 @@ int HugoOperations::setValueForAttr(NdbOperation* pOp, int check = 0; const NdbDictionary::Column* attr = tab.getColumn(attrId); - if (attr->getTupleKey()){ - // Don't set values for TupleId PKs - return check; - } - switch (attr->getType()){ case NdbDictionary::Column::Char: case NdbDictionary::Column::Varchar: diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp index ff6db3e892c..b61d48b216c 100644 --- a/ndb/test/src/NDBT_Tables.cpp +++ b/ndb/test/src/NDBT_Tables.cpp @@ -820,21 +820,25 @@ NDBT_Tables::createAllTables(Ndb* pNdb){ int NDBT_Tables::createTable(Ndb* pNdb, const char* _name, bool _temp, - bool existsOk){ + bool existsOk, NDBT_CreateTableHook f){ const NdbDictionary::Table* tab = NDBT_Tables::getTable(_name); if (tab == NULL){ ndbout << "Could not create table " << _name << ", it doesn't exist in list of tables "\ - "that NDBT_Tables can create!" << endl; + "that NDBT_Tables can create!" << endl; return NDBT_WRONGARGS; } - + int r = 0; do { NdbDictionary::Table tmpTab(* tab); tmpTab.setStoredTable(_temp ? 0 : 1); - + if(f != 0 && f(pNdb, tmpTab, 0)) + { + ndbout << "Failed to create table" << endl; + return NDBT_FAILED; + } r = pNdb->getDictionary()->createTable(tmpTab); if(r == -1){ if(!existsOk){ @@ -883,6 +887,11 @@ NDBT_Tables::createTable(Ndb* pNdb, const char* _name, bool _temp, } } } + if(f != 0 && f(pNdb, tmpTab, 1)) + { + ndbout << "Failed to create table" << endl; + return NDBT_FAILED; + } } while(false); return r; diff --git a/ndb/test/src/NdbSchemaOp.cpp b/ndb/test/src/NdbSchemaOp.cpp index a296094ea9d..9bce0b10fc3 100644 --- a/ndb/test/src/NdbSchemaOp.cpp +++ b/ndb/test/src/NdbSchemaOp.cpp @@ -158,7 +158,6 @@ NdbSchemaOp::createAttribute( const char* anAttrName, col.setPrimaryKey(false); col.setDistributionKey(aDistributionKeyFlag); - col.setDistributionGroup(aDistributionGroupFlag,aDistributionGroupNoOfBits); col.setAutoIncrement(aAutoIncrement); col.setDefaultValue(aDefaultValue != 0 ? aDefaultValue : ""); |