summaryrefslogtreecommitdiff
path: root/ndb/test
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-10-10 09:52:35 +0200
committerunknown <jonas@perch.ndb.mysql.com>2006-10-10 09:52:35 +0200
commit0125c351e33116c778fa2244bb3ad2f1467a196e (patch)
treec6a42cc6c25858d02d4a6a4565252912debeecc9 /ndb/test
parent66fbc60dc3ba07814fe17186a0e1e01d709ad520 (diff)
parent6a4289c23d911e36584f2f382ca23f3d978e98fc (diff)
downloadmariadb-git-0125c351e33116c778fa2244bb3ad2f1467a196e.tar.gz
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
Diffstat (limited to 'ndb/test')
-rw-r--r--ndb/test/ndbapi/testTimeout.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/ndb/test/ndbapi/testTimeout.cpp b/ndb/test/ndbapi/testTimeout.cpp
index 36fb34a50e2..e719cdf03e9 100644
--- a/ndb/test/ndbapi/testTimeout.cpp
+++ b/ndb/test/ndbapi/testTimeout.cpp
@@ -388,6 +388,45 @@ int runBuddyTransNoTimeout(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+int runBuddyTransTimeout(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ int stepNo = step->getStepNo();
+ ndbout << "TransactionInactiveTimeout="<< TIMEOUT <<endl;
+
+ HugoOperations hugoOps(*ctx->getTab());
+ Ndb* pNdb = GETNDB(step);
+
+ for (int l = 1; l < loops && result == NDBT_OK; l++){
+
+ NdbTransaction* pTrans = 0;
+ do{
+ pTrans = pNdb->startTransaction();
+ NdbScanOperation* pOp = pTrans->getNdbScanOperation(ctx->getTab());
+ CHECK(pOp->readTuples(NdbOperation::LM_Read, 0, 0, 1) == 0);
+ CHECK(pTrans->execute(NoCommit) == 0);
+
+ int sleep = 2 * TIMEOUT;
+ ndbout << "Sleeping for " << sleep << " milliseconds" << endl;
+ NdbSleep_MilliSleep(sleep);
+
+ int res = 0;
+ while((res = pOp->nextResult()) == 0);
+ ndbout_c("res: %d", res);
+ CHECK(res == -1);
+
+ } while(false);
+
+ if (pTrans)
+ {
+ pTrans->close();
+ }
+ }
+
+ return result;
+}
+
int
runError4012(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
@@ -495,6 +534,15 @@ TESTCASE("BuddyTransNoTimeout5",
FINALIZER(resetTransactionTimeout);
FINALIZER(runClearTable);
}
+TESTCASE("BuddyTransTimeout1",
+ "Start a scan and check that it gets aborted"){
+ INITIALIZER(runLoadTable);
+ INITIALIZER(setTransactionTimeout);
+ STEPS(runBuddyTransTimeout, 1);
+ FINALIZER(resetTransactionTimeout);
+ FINALIZER(runClearTable);
+}
+#if 0
TESTCASE("Error4012", ""){
TC_PROPERTY("TransactionDeadlockTimeout", 120000);
INITIALIZER(runLoadTable);
@@ -503,7 +551,7 @@ TESTCASE("Error4012", ""){
STEPS(runError4012, 2);
FINALIZER(runClearTable);
}
-
+#endif
NDBT_TESTSUITE_END(testTimeout);
int main(int argc, const char** argv){