3445 Jonas Oreland 2011-06-28
ndb - bug#12646659 - don't refresh closed scans
modified:
storage/ndb/src/ndbapi/NdbTransaction.cpp
storage/ndb/test/ndbapi/testScan.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
3444 Jonas Oreland 2011-06-16
ndb - Make sure that INCIDENT_LOST_EVENTS is only emitted once, if setting up binlog (after binlog restart) fails.
modified:
sql/ha_ndbcluster_binlog.cc
=== modified file 'storage/ndb/src/ndbapi/NdbTransaction.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp 2011-02-01 21:05:11 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp 2011-06-28 08:40:56 +0000
@@ -812,7 +812,10 @@ int NdbTransaction::refresh()
scan_op != 0; scan_op = (NdbIndexScanOperation *) scan_op->theNext)
{
NdbTransaction* scan_trans = scan_op->theNdbCon;
- scan_trans->sendTC_HBREP();
+ if (scan_trans)
+ {
+ scan_trans->sendTC_HBREP();
+ }
}
return sendTC_HBREP();
}
=== modified file 'storage/ndb/test/ndbapi/testScan.cpp'
--- a/storage/ndb/test/ndbapi/testScan.cpp 2010-08-31 10:40:36 +0000
+++ b/storage/ndb/test/ndbapi/testScan.cpp 2011-06-28 08:40:56 +0000
@@ -1411,6 +1411,86 @@ runBug54945(NDBT_Context* ctx, NDBT_Step
return NDBT_OK;
}
+int
+runCloseRefresh(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Ndb * pNdb = GETNDB(step);
+
+ const Uint32 codeWords= 1;
+ Uint32 codeSpace[ codeWords ];
+ NdbInterpretedCode code(NULL, // Table is irrelevant
+ &codeSpace[0],
+ codeWords);
+ if ((code.interpret_exit_last_row() != 0) ||
+ (code.finalise() != 0))
+ {
+ ERR(code.getNdbError());
+ return NDBT_FAILED;
+ }
+
+ const NdbDictionary::Table* pTab = ctx->getTab();
+ NdbTransaction* pTrans = pNdb->startTransaction();
+ NdbScanOperation* pOp = pTrans->getNdbScanOperation(pTab->getName());
+ if (pOp == NULL)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ if (pOp->readTuples(NdbOperation::LM_CommittedRead) != 0)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ if (pOp->setInterpretedCode(&code) == -1 )
+ {
+ ERR(pTrans->getNdbError());
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ if (pOp->getValue(NdbDictionary::Column::ROW_COUNT) == 0)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ pTrans->execute(NdbTransaction::NoCommit);
+ pOp->close(); // close this
+
+ pOp = pTrans->getNdbScanOperation(pTab->getName());
+ if (pOp == NULL)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ if (pOp->readTuples(NdbOperation::LM_CommittedRead) != 0)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ if (pOp->setInterpretedCode(&code) == -1 )
+ {
+ ERR(pTrans->getNdbError());
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ if (pOp->getValue(NdbDictionary::Column::ROW_COUNT) == 0)
+ {
+ ERR(pTrans->getNdbError());
+ return NDBT_FAILED;
+ }
+
+ pTrans->execute(NdbTransaction::NoCommit);
+ pTrans->refresh();
+ pTrans->close();
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testScan);
TESTCASE("ScanRead",
"Verify scan requirement: It should be possible "\
@@ -1937,6 +2017,10 @@ TESTCASE("Bug42559", "")
FINALIZER(finalizeBug42559);
FINALIZER(runClearTable);
}
+TESTCASE("CloseRefresh", "")
+{
+ INITIALIZER(runCloseRefresh);
+}
TESTCASE("Bug54945", "")
{
INITIALIZER(runBug54945);
=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt 2011-04-07 19:57:33 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2011-06-28 08:40:56 +0000
@@ -473,6 +473,10 @@ args: -n NoCloseTransaction T6 D1 D2
max-time: 500
cmd: testScan
+args: -n CloseRefresh T1
+
+max-time: 500
+cmd: testScan
args: -n CheckInactivityTimeOut T6 D1 D2
max-time: 500
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-6.3 branch (jonas.oreland:3444 to 3445)Bug#12646659 | Jonas Oreland | 28 Jun |