Loading ndb/src/ndbapi/NdbOperationExec.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -104,8 +104,9 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) { Uint32 tTransId1, tTransId2; Uint32 tReqInfo; Uint32 tInterpretInd = theInterpretIndicator; Uint8 tInterpretInd = theInterpretIndicator; Uint8 tDirtyIndicator = theDirtyIndicator; Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len; theErrorLine = 0; if (tInterpretInd != 1) { Loading @@ -123,7 +124,13 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) if (tStatus != GetValue) { setErrorCodeAbort(4116); return -1; }//if } else if(unlikely(tDirtyIndicator && tTotalCurrAI_Len == 0)) { getValue(NdbDictionary::Column::FRAGMENT); tTotalCurrAI_Len = theTotalCurrAI_Len; assert(theTotalCurrAI_Len); } } else { setErrorCodeAbort(4005); return -1; Loading @@ -140,7 +147,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) //------------------------------------------------------------- TcKeyReq * const tcKeyReq = CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend()); Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len; Uint32 tTableId = m_currentTable->m_tableId; Uint32 tSchemaVersion = m_currentTable->m_version; Loading Loading @@ -188,7 +194,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) tcKeyReq->setStartFlag(tReqInfo, tStartIndicator); tcKeyReq->setInterpretedFlag(tReqInfo, tInterpretIndicator); Uint8 tDirtyIndicator = theDirtyIndicator; OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; Uint8 abortOption = Loading ndb/test/ndbapi/testNdbApi.cpp +48 −16 Original line number Diff line number Diff line Loading @@ -884,25 +884,16 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ HugoOperations hugoOps(*pTab); Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; } if (pNdb->init()){ ERR(pNdb->getNdbError()); delete pNdb; return NDBT_FAILED; } Ndb* pNdb = GETNDB(step); Uint32 lm; for(Uint32 cm= 0; cm < 2; cm++) { for(Uint32 lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++) for(lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++) { NdbConnection* pCon = pNdb->startTransaction(); if (pCon == NULL){ pNdb->closeTransaction(pCon); delete pNdb; return NDBT_FAILED; } Loading @@ -910,14 +901,12 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ if (pOp == NULL){ ERR(pCon->getNdbError()); pNdb->closeTransaction(pCon); delete pNdb; return NDBT_FAILED; } if (pOp->readTuple((NdbOperation::LockMode)lm) != 0){ pNdb->closeTransaction(pCon); ERR(pOp->getNdbError()); delete pNdb; return NDBT_FAILED; } Loading @@ -926,7 +915,6 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ if(hugoOps.equalForAttr(pOp, a, 1) != 0){ ERR(pCon->getNdbError()); pNdb->closeTransaction(pCon); delete pNdb; return NDBT_FAILED; } } Loading @@ -946,7 +934,51 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ pNdb->closeTransaction(pCon); } } delete pNdb; /** * Now test scans */ for(lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++) { NdbConnection* pCon = pNdb->startTransaction(); if (pCon == NULL){ pNdb->closeTransaction(pCon); return NDBT_FAILED; } NdbScanOperation* pOp = pCon->getNdbScanOperation(pTab->getName()); if (pOp == NULL){ ERR(pCon->getNdbError()); pNdb->closeTransaction(pCon); return NDBT_FAILED; } NdbResultSet *rs; if ((rs = pOp->readTuples((NdbOperation::LockMode)lm)) == 0){ pNdb->closeTransaction(pCon); ERR(pOp->getNdbError()); return NDBT_FAILED; } // Dont' call any getValues // Execute should work int check = pCon->execute(NoCommit); if (check == 0){ ndbout << "execute worked" << endl; } else { ERR(pCon->getNdbError()); result = NDBT_FAILED; } int res; while((res = rs->nextResult()) == 0); pNdb->closeTransaction(pCon); if(res != 1) result = NDBT_FAILED; } return result; } Loading Loading
ndb/src/ndbapi/NdbOperationExec.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -104,8 +104,9 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) { Uint32 tTransId1, tTransId2; Uint32 tReqInfo; Uint32 tInterpretInd = theInterpretIndicator; Uint8 tInterpretInd = theInterpretIndicator; Uint8 tDirtyIndicator = theDirtyIndicator; Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len; theErrorLine = 0; if (tInterpretInd != 1) { Loading @@ -123,7 +124,13 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) if (tStatus != GetValue) { setErrorCodeAbort(4116); return -1; }//if } else if(unlikely(tDirtyIndicator && tTotalCurrAI_Len == 0)) { getValue(NdbDictionary::Column::FRAGMENT); tTotalCurrAI_Len = theTotalCurrAI_Len; assert(theTotalCurrAI_Len); } } else { setErrorCodeAbort(4005); return -1; Loading @@ -140,7 +147,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) //------------------------------------------------------------- TcKeyReq * const tcKeyReq = CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend()); Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len; Uint32 tTableId = m_currentTable->m_tableId; Uint32 tSchemaVersion = m_currentTable->m_version; Loading Loading @@ -188,7 +194,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) tcKeyReq->setStartFlag(tReqInfo, tStartIndicator); tcKeyReq->setInterpretedFlag(tReqInfo, tInterpretIndicator); Uint8 tDirtyIndicator = theDirtyIndicator; OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; Uint8 abortOption = Loading
ndb/test/ndbapi/testNdbApi.cpp +48 −16 Original line number Diff line number Diff line Loading @@ -884,25 +884,16 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ HugoOperations hugoOps(*pTab); Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB"); if (pNdb == NULL){ ndbout << "pNdb == NULL" << endl; return NDBT_FAILED; } if (pNdb->init()){ ERR(pNdb->getNdbError()); delete pNdb; return NDBT_FAILED; } Ndb* pNdb = GETNDB(step); Uint32 lm; for(Uint32 cm= 0; cm < 2; cm++) { for(Uint32 lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++) for(lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++) { NdbConnection* pCon = pNdb->startTransaction(); if (pCon == NULL){ pNdb->closeTransaction(pCon); delete pNdb; return NDBT_FAILED; } Loading @@ -910,14 +901,12 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ if (pOp == NULL){ ERR(pCon->getNdbError()); pNdb->closeTransaction(pCon); delete pNdb; return NDBT_FAILED; } if (pOp->readTuple((NdbOperation::LockMode)lm) != 0){ pNdb->closeTransaction(pCon); ERR(pOp->getNdbError()); delete pNdb; return NDBT_FAILED; } Loading @@ -926,7 +915,6 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ if(hugoOps.equalForAttr(pOp, a, 1) != 0){ ERR(pCon->getNdbError()); pNdb->closeTransaction(pCon); delete pNdb; return NDBT_FAILED; } } Loading @@ -946,7 +934,51 @@ int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){ pNdb->closeTransaction(pCon); } } delete pNdb; /** * Now test scans */ for(lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++) { NdbConnection* pCon = pNdb->startTransaction(); if (pCon == NULL){ pNdb->closeTransaction(pCon); return NDBT_FAILED; } NdbScanOperation* pOp = pCon->getNdbScanOperation(pTab->getName()); if (pOp == NULL){ ERR(pCon->getNdbError()); pNdb->closeTransaction(pCon); return NDBT_FAILED; } NdbResultSet *rs; if ((rs = pOp->readTuples((NdbOperation::LockMode)lm)) == 0){ pNdb->closeTransaction(pCon); ERR(pOp->getNdbError()); return NDBT_FAILED; } // Dont' call any getValues // Execute should work int check = pCon->execute(NoCommit); if (check == 0){ ndbout << "execute worked" << endl; } else { ERR(pCon->getNdbError()); result = NDBT_FAILED; } int res; while((res = rs->nextResult()) == 0); pNdb->closeTransaction(pCon); if(res != 1) result = NDBT_FAILED; } return result; } Loading