3870 Jonas Oreland 2010-10-06 [merge]
ndb - merge 70 to 71
modified:
storage/ndb/src/ndbapi/Ndbif.cpp
storage/ndb/test/ndbapi/testNdbApi.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
3869 Jonas Oreland 2010-10-06 [merge]
ndb - merge 70 to 71
modified:
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
=== modified file 'storage/ndb/src/ndbapi/Ndbif.cpp'
--- a/storage/ndb/src/ndbapi/Ndbif.cpp 2010-10-05 13:38:17 +0000
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp 2010-10-06 08:59:33 +0000
@@ -1332,6 +1332,7 @@ Ndb::poll_trans(int aMillisecondNumber,
} else {
tNoCompletedTransactions = pollCompleted(tConArray);
}//if
+ theMinNoOfEventsToWakeUp = 0; // no more wakup
pg->unlock_and_signal();
reportCallback(tConArray, tNoCompletedTransactions);
return tNoCompletedTransactions;
=== modified file 'storage/ndb/test/ndbapi/testNdbApi.cpp'
--- a/storage/ndb/test/ndbapi/testNdbApi.cpp 2010-08-09 09:08:03 +0000
+++ b/storage/ndb/test/ndbapi/testNdbApi.cpp 2010-10-06 08:59:33 +0000
@@ -3277,6 +3277,91 @@ int runReadColumnDuplicates(NDBT_Context
return result;
}
+class TransGuard
+{
+ NdbTransaction* pTrans;
+public:
+ TransGuard(NdbTransaction * p) : pTrans(p) {}
+ ~TransGuard() { if (pTrans) pTrans->close(); pTrans = 0; }
+};
+
+int
+runBug51775(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Ndb* pNdb = GETNDB(step);
+
+ NdbTransaction * pTrans1 = pNdb->startTransaction();
+ if (pTrans1 == NULL)
+ {
+ ERR(pNdb->getNdbError());
+ return NDBT_FAILED;
+ }
+ TransGuard g1(pTrans1);
+
+ NdbTransaction * pTrans2 = pNdb->startTransaction();
+ if (pTrans2 == NULL)
+ {
+ pTrans1->close();
+ ERR(pNdb->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ TransGuard g2(pTrans2);
+
+ {
+ NdbOperation * pOp = pTrans1->getNdbOperation(ctx->getTab()->getName());
+ if (pOp == NULL)
+ {
+ ERR(pOp->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ if (pOp->insertTuple() != 0)
+ {
+ ERR(pOp->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ HugoOperations hugoOps(* ctx->getTab());
+ hugoOps.setValues(pOp, 0, 0);
+ }
+
+ {
+ NdbOperation * pOp = pTrans2->getNdbOperation(ctx->getTab()->getName());
+ if (pOp == NULL)
+ {
+ ERR(pOp->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ if (pOp->readTuple() != 0)
+ {
+ ERR(pOp->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ HugoOperations hugoOps(* ctx->getTab());
+ hugoOps.equalForRow(pOp, 0);
+ pOp->getValue(NdbDictionary::Column::FRAGMENT);
+ }
+
+
+ pTrans1->execute(NoCommit); // We now have un uncommitted insert
+
+ /**
+ * Now send a read...which will get 266
+ */
+ pTrans2->executeAsynch(NoCommit, 0, 0);
+ int res = pNdb->pollNdb(1, 1000);
+ ndbout_c("res: %u", res);
+
+ NdbSleep_SecSleep(10);
+ ndbout_c("pollNdb()");
+ while (pNdb->pollNdb() + res == 0);
+
+ return NDBT_OK;
+}
+
int testFragmentedApiFailImpl(NDBT_Context* ctx, NDBT_Step* step)
{
/* Setup a separate connection for running scan operations
@@ -4439,7 +4524,6 @@ int runTestUnlockScan(NDBT_Context* ctx,
return NDBT_OK;
}
-
NDBT_TESTSUITE(testNdbApi);
TESTCASE("MaxNdb",
"Create Ndb objects until no more can be created\n"){
@@ -4613,6 +4697,10 @@ TESTCASE("ReadColumnDuplicates",
STEP(runReadColumnDuplicates);
FINALIZER(runClearTable);
}
+TESTCASE("Bug51775", "")
+{
+ INITIALIZER(runBug51775);
+}
TESTCASE("FragmentedApiFailure",
"Test in-assembly fragment cleanup code for API failure") {
// We reuse some of the infrastructure from ApiFailReqBehaviour here
=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt 2010-09-29 08:54:47 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2010-10-06 08:59:33 +0000
@@ -1518,6 +1518,10 @@ cmd: testNdbApi
args: -n ReadColumnDuplicates
max-time: 300
+cmd: testNdbApi
+args: -n Bug51775 T1
+
+max-time: 300
cmd: testBasic
args: -n DDInsertFailUpdateBatch
@@ -1601,4 +1605,3 @@ max-time: 500
cmd testNodeRestart
args: -n ForceStopAndRestart T1
-
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101006090116-24gm095dvw90ebu8.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (jonas:3869 to 3870) | Jonas Oreland | 6 Oct |