diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2006-12-15 17:24:15 +0100 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2006-12-15 17:24:15 +0100 |
commit | da5a804366f7f88f45e801ab1e559e00234803e9 (patch) | |
tree | 1cedc8efcd924f8911e83f137ba7e3f7e347c149 /ndb/test | |
parent | bc675bbdb56128d0dba3d6fdaa80d167b3b44df5 (diff) | |
parent | 9a79c0dc68eb2359771546a0151a185f8eed90f1 (diff) | |
download | mariadb-git-da5a804366f7f88f45e801ab1e559e00234803e9.tar.gz |
Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
ndb/src/ndbapi/NdbTransaction.cpp:
Auto merged
ndb/src/ndbapi/Ndbif.cpp:
Auto merged
ndb/test/run-test/daily-basic-tests.txt:
Auto merged
Diffstat (limited to 'ndb/test')
-rw-r--r-- | ndb/test/ndbapi/testBasic.cpp | 26 | ||||
-rw-r--r-- | ndb/test/ndbapi/testIndex.cpp | 65 | ||||
-rw-r--r-- | ndb/test/run-test/daily-basic-tests.txt | 8 |
3 files changed, 99 insertions, 0 deletions
diff --git a/ndb/test/ndbapi/testBasic.cpp b/ndb/test/ndbapi/testBasic.cpp index 4d64b15ecfa..10235eef6d7 100644 --- a/ndb/test/ndbapi/testBasic.cpp +++ b/ndb/test/ndbapi/testBasic.cpp @@ -1034,6 +1034,28 @@ runMassiveRollback2(NDBT_Context* ctx, NDBT_Step* step){ return result; } +int +runBug25090(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(); + + while (loops--) + { + ops.startTransaction(pNdb); + ops.pkReadRecord(pNdb, 1, 1); + ops.execute_Commit(pNdb, AO_IgnoreError); + sleep(10); + ops.closeTransaction(pNdb); + } + + return NDBT_OK; +} NDBT_TESTSUITE(testBasic); TESTCASE("PkInsert", @@ -1277,6 +1299,10 @@ TESTCASE("Fill", INITIALIZER(runPkRead); FINALIZER(runClearTable2); } +TESTCASE("Bug25090", + "Verify what happens when we fill the db" ){ + STEP(runBug25090); +} NDBT_TESTSUITE_END(testBasic); #if 0 diff --git a/ndb/test/ndbapi/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp index c25aae55897..bec649cf84d 100644 --- a/ndb/test/ndbapi/testIndex.cpp +++ b/ndb/test/ndbapi/testIndex.cpp @@ -1239,7 +1239,64 @@ runBug21384(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug25059(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary * dict = pNdb->getDictionary(); + const NdbDictionary::Index * idx = dict->getIndex(pkIdxName, *ctx->getTab()); + HugoOperations ops(*ctx->getTab(), idx); + + int res = NDBT_OK; + int loops = ctx->getNumLoops(); + const int rows = ctx->getNumRecords(); + + while (res == NDBT_OK && loops--) + { + ops.startTransaction(pNdb); + ops.pkReadRecord(pNdb, 10 + rand() % rows, rows); + int tmp; + if (tmp = ops.execute_Commit(pNdb, AO_IgnoreError)) + { + if (tmp == 4012) + res = NDBT_FAILED; + else + if (ops.getTransaction()->getNdbError().code == 4012) + res = NDBT_FAILED; + } + ops.closeTransaction(pNdb); + } + + loops = ctx->getNumLoops(); + while (res == NDBT_OK && loops--) + { + ops.startTransaction(pNdb); + ops.pkUpdateRecord(pNdb, 10 + rand() % rows, rows); + int tmp; + int arg; + switch(rand() % 2){ + case 0: + arg = AbortOnError; + break; + case 1: + arg = AO_IgnoreError; + ndbout_c("ignore error"); + break; + } + if (tmp = ops.execute_Commit(pNdb, (AbortOption)arg)) + { + if (tmp == 4012) + res = NDBT_FAILED; + else + if (ops.getTransaction()->getNdbError().code == 4012) + res = NDBT_FAILED; + } + ops.closeTransaction(pNdb); + } + + return res; +} NDBT_TESTSUITE(testIndex); TESTCASE("CreateAll", @@ -1564,6 +1621,14 @@ TESTCASE("Bug21384", FINALIZER(createPkIndex_Drop); FINALIZER(runClearTable); } +TESTCASE("Bug25059", + "Test that unique indexes and nulls"){ + TC_PROPERTY("LoggedIndexes", (unsigned)0); + INITIALIZER(createPkIndex); + INITIALIZER(runLoadTable); + STEP(runBug25059); + FINALIZER(createPkIndex_Drop); +} NDBT_TESTSUITE_END(testIndex); int main(int argc, const char** argv){ diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index bbfc2f630b9..5fc10f6284b 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -211,6 +211,14 @@ max-time: 500 cmd: testTimeout args: T1 +max-time: 500 +cmd: testBasic +args: -n Bug25090 T1 + +max-time: 500 +cmd: testIndex +args: -n Bug25059 -r 3000 T1 + # SCAN TESTS # max-time: 500 |