diff options
author | unknown <joreland@mysql.com> | 2005-06-09 15:44:57 +0200 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2005-06-09 15:44:57 +0200 |
commit | 66ef0f1440b04719ba7184d1bb1fa3ffa06dd1ff (patch) | |
tree | f7b4e570c0747bc54f65bc53d3ad52ad88b4763a /ndb/test/ndbapi | |
parent | fa02ee1a5287f4f7df757010bd191b5c34f45796 (diff) | |
parent | 2f2ab54691698b6ce21308f6dcbd85738d658173 (diff) | |
download | mariadb-git-66ef0f1440b04719ba7184d1bb1fa3ffa06dd1ff.tar.gz |
merge
ndb/include/ndbapi/Ndb.hpp:
Auto merged
ndb/src/ndbapi/Ndbif.cpp:
Auto merged
ndb/src/ndbapi/Ndbinit.cpp:
Auto merged
ndb/test/ndbapi/testNdbApi.cpp:
Auto merged
ndb/test/run-test/daily-basic-tests.txt:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
Diffstat (limited to 'ndb/test/ndbapi')
-rw-r--r-- | ndb/test/ndbapi/testNdbApi.cpp | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index 65324af6fe6..000fbcdd66a 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -1269,6 +1269,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<NdbResultSet*> 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; i<scans.size(); i++) + { + NdbResultSet* pOp= scans[i]; + while((check= pOp->nextResult()) == 0); + if(check != 1) + { + ERR(pOp->getOperation()->getNdbError()); + pNdb->closeTransaction(pCon); + delete pNdb; + return NDBT_FAILED; + } + } + + pNdb->closeTransaction(pCon); + + Vector<NdbConnection*> cons; + for(i= 0; i<10*max; i++) + { + pCon= pNdb->startTransaction(); + if(pCon) + cons.push_back(pCon); + else + break; + } + + for(i= 0; i<cons.size(); i++) + { + cons[i]->close(); + } + + if(cons.size() != max) + { + result= NDBT_FAILED; + } + + delete pNdb; + + return result; +} + +template class Vector<NdbResultSet*>; NDBT_TESTSUITE(testNdbApi); @@ -1351,6 +1447,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){ |