diff options
Diffstat (limited to 'storage/ndb/test/ndbapi/testBasic.cpp')
-rw-r--r-- | storage/ndb/test/ndbapi/testBasic.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/storage/ndb/test/ndbapi/testBasic.cpp b/storage/ndb/test/ndbapi/testBasic.cpp index 83c2628f8b0..a032e29bc74 100644 --- a/storage/ndb/test/ndbapi/testBasic.cpp +++ b/storage/ndb/test/ndbapi/testBasic.cpp @@ -1318,6 +1318,64 @@ runDeleteRead(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int +runBug27756(NDBT_Context* ctx, NDBT_Step* step) +{ + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary * dict = pNdb->getDictionary(); + + HugoOperations ops(*ctx->getTab()); + + int loops = ctx->getNumLoops(); + const int rows = ctx->getNumRecords(); + + Vector<Uint64> copies; + while (loops--) + { + ops.startTransaction(pNdb); + ops.pkInsertRecord(pNdb, 1, 1); + ops.execute_NoCommit(pNdb); + + NdbTransaction* pTrans = ops.getTransaction(); + NdbOperation* op = pTrans->getNdbOperation(ctx->getTab()->getName()); + op->interpretedUpdateTuple(); + ops.equalForRow(op, 1); + NdbRecAttr* attr = op->getValue(NdbDictionary::Column::COPY_ROWID); + ops.execute_NoCommit(pNdb); + + copies.push_back(attr->u_64_value()); + ndbout_c("copy at: %llx", copies.back()); + ops.execute_NoCommit(pNdb); + + ops.pkDeleteRecord(pNdb, 1, 1); + ops.execute_NoCommit(pNdb); + + if (loops & 1) + { + ops.execute_Rollback(pNdb); + ops.closeTransaction(pNdb); + } + else + { + ops.execute_Commit(pNdb); + ops.closeTransaction(pNdb); + ops.clearTable(pNdb, 100); + } + } + + for (Uint32 i = 0; i<copies.size(); i++) + if (copies[i] != copies.back()) + { + ndbout_c("Memleak detected"); + return NDBT_FAILED; + } + + return NDBT_OK; +} + +template class Vector<Uint64>; + NDBT_TESTSUITE(testBasic); TESTCASE("PkInsert", "Verify that we can insert and delete from this table using PK" @@ -1594,6 +1652,10 @@ TESTCASE("DeleteRead", INITIALIZER(runDeleteRead); FINALIZER(runClearTable2); } +TESTCASE("Bug27756", + "Verify what happens when we fill the db" ){ + STEP(runBug27756); +} NDBT_TESTSUITE_END(testBasic); #if 0 |