summaryrefslogtreecommitdiff
path: root/ndb/test/ndbapi/testDict.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ndb/test/ndbapi/testDict.cpp')
-rw-r--r--ndb/test/ndbapi/testDict.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp
index 712ab2e4d25..5f88342705a 100644
--- a/ndb/test/ndbapi/testDict.cpp
+++ b/ndb/test/ndbapi/testDict.cpp
@@ -1211,7 +1211,7 @@ runTableRename(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str());
if (oldTable) {
- NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str());
+ NdbDictionary::Table newTable = *oldTable;
newTable.setName(pTabNewName.c_str());
CHECK2(dict->alterTable(newTable) == 0,
"TableRename failed");
@@ -1280,7 +1280,7 @@ runTableRenameNF(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str());
if (oldTable) {
- NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str());
+ NdbDictionary::Table newTable = *oldTable;
newTable.setName(pTabNewName.c_str());
CHECK2(dict->alterTable(newTable) == 0,
"TableRename failed");
@@ -1377,7 +1377,7 @@ runTableRenameSR(NDBT_Context* ctx, NDBT_Step* step){
const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str());
if (oldTable) {
- NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str());
+ NdbDictionary::Table newTable = *oldTable;
newTable.setName(pTabNewName.c_str());
CHECK2(dict->alterTable(newTable) == 0,
"TableRename failed");
@@ -1480,8 +1480,10 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){
}
int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){
+ static int acclst[] = { 3001 };
static int tuplst[] = { 4007, 4008, 4009, 4010, 4011, 4012 };
static int tuxlst[] = { 12001, 12002, 12003, 12004, 12005, 12006 };
+ static unsigned acccnt = sizeof(acclst)/sizeof(acclst[0]);
static unsigned tupcnt = sizeof(tuplst)/sizeof(tuplst[0]);
static unsigned tuxcnt = sizeof(tuxlst)/sizeof(tuxlst[0]);
@@ -1509,6 +1511,19 @@ int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){
(void)pDic->dropTable(tab.getName());
for (int l = 0; l < loops; l++) {
+ for (unsigned i0 = 0; i0 < acccnt; i0++) {
+ unsigned j = (l == 0 ? i0 : myRandom48(acccnt));
+ int errval = acclst[j];
+ g_info << "insert error node=" << nodeId << " value=" << errval << endl;
+ CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0,
+ "failed to set error insert");
+ CHECK2(pDic->createTable(tab) != 0,
+ "failed to fail after error insert " << errval);
+ CHECK2(pDic->createTable(tab) == 0,
+ pDic->getNdbError());
+ CHECK2(pDic->dropTable(tab.getName()) == 0,
+ pDic->getNdbError());
+ }
for (unsigned i1 = 0; i1 < tupcnt; i1++) {
unsigned j = (l == 0 ? i1 : myRandom48(tupcnt));
int errval = tuplst[j];
@@ -1638,7 +1653,7 @@ TESTCASE("DictionaryPerf",
INITIALIZER(runTestDictionaryPerf);
}
TESTCASE("FailAddFragment",
- "Fail add fragment or attribute in TUP or TUX\n"){
+ "Fail add fragment or attribute in ACC or TUP or TUX\n"){
INITIALIZER(runFailAddFragment);
}
NDBT_TESTSUITE_END(testDict);
@@ -1650,5 +1665,3 @@ int main(int argc, const char** argv){
myRandom48Init(NdbTick_CurrentMillisecond());
return testDict.execute(argc, argv);
}
-
-