From 2f2ab54691698b6ce21308f6dcbd85738d658173 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Jun 2005 15:39:14 +0200 Subject: bug#11205 - ndb - 4006 when starting scan mysql-test/r/ndb_subquery.result: Add testing of new 4006 handling mysql-test/t/ndb_subquery.test: Add testing of new 4006 handling ndb/include/ndbapi/Ndb.hpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndb.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/NdbScanOperation.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndbif.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndbinit.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/src/ndbapi/Ndblist.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/test/ndbapi/testNdbApi.cpp: Check #transactions in startTransaction instead of getNdbCon ndb/test/run-test/daily-basic-tests.txt: Check #transactions in startTransaction instead of getNdbCon sql/ha_ndbcluster.cc: Check #transactions in startTransaction instead of getNdbCon --- ndb/test/ndbapi/testNdbApi.cpp | 102 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) (limited to 'ndb/test/ndbapi') diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index de731a5eeec..d38ac460dfb 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -1281,6 +1281,102 @@ int runBug_11133(NDBT_Context* ctx, NDBT_Step* step){ return result; } +int runScan_4006(NDBT_Context* ctx, NDBT_Step* step){ + int result = NDBT_OK; + const Uint32 max= 5; + const NdbDictionary::Table* pTab = ctx->getTab(); + + Ndb* pNdb = new Ndb("TEST_DB"); + if (pNdb == NULL){ + ndbout << "pNdb == NULL" << endl; + return NDBT_FAILED; + } + if (pNdb->init(max)){ + ERR(pNdb->getNdbError()); + delete pNdb; + return NDBT_FAILED; + } + + NdbConnection* pCon = pNdb->startTransaction(); + if (pCon == NULL){ + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + + Uint32 i; + Vector scans; + for(i = 0; i<10*max; i++) + { + NdbScanOperation* pOp = pCon->getNdbScanOperation(pTab->getName()); + if (pOp == NULL){ + ERR(pCon->getNdbError()); + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + + NdbResultSet* rs; + if ((rs= pOp->readTuples()) == 0){ + pNdb->closeTransaction(pCon); + ERR(pOp->getNdbError()); + delete pNdb; + return NDBT_FAILED; + } + scans.push_back(rs); + } + + // Dont' call any equal or setValues + + // Execute should not work + int check = pCon->execute(NoCommit); + if (check == 0){ + ndbout << "execute worked" << endl; + } else { + ERR(pCon->getNdbError()); + } + + for(i= 0; inextResult()) == 0); + if(check != 1) + { + ERR(pOp->getOperation()->getNdbError()); + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + } + + pNdb->closeTransaction(pCon); + + Vector cons; + for(i= 0; i<10*max; i++) + { + pCon= pNdb->startTransaction(); + if(pCon) + cons.push_back(pCon); + else + break; + } + + for(i= 0; iclose(); + } + + if(cons.size() != max) + { + result= NDBT_FAILED; + } + + delete pNdb; + + return result; +} + +template class Vector; NDBT_TESTSUITE(testNdbApi); @@ -1363,6 +1459,12 @@ TESTCASE("Bug_11133", INITIALIZER(runBug_11133); FINALIZER(runClearTable); } +TESTCASE("Scan_4006", + "Check that getNdbScanOperation does not get 4006\n"){ + INITIALIZER(runLoadTable); + INITIALIZER(runScan_4006); + FINALIZER(runClearTable); +} NDBT_TESTSUITE_END(testNdbApi); int main(int argc, const char** argv){ -- cgit v1.2.1