diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 8e3ca6528c2dc7c8128cef7ad0135031725ac8e9..cb5477a1551d40714fa2fbde951851aa294b537f 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -858,6 +858,8 @@ void Dbtup::sendTUPKEYCONF(Signal* signal, return; }//Dbtup::sendTUPKEYCONF() +#define MAX_READ (sizeof(signal->theData) > MAX_MESSAGE_SIZE ? MAX_MESSAGE_SIZE : sizeof(signal->theData)) + /* ---------------------------------------------------------------- */ /* ----------------------------- READ ---------------------------- */ /* ---------------------------------------------------------------- */ @@ -878,7 +880,7 @@ int Dbtup::handleReadReq(Signal* signal, }//if Uint32 * dst = &signal->theData[25]; - Uint32 dstLen = (sizeof(signal->theData) / 4) - 25; + Uint32 dstLen = (MAX_READ / 4) - 25; const Uint32 node = refToNode(sendBref); if(node != 0 && node != getOwnNodeId()) { ; @@ -888,7 +890,7 @@ int Dbtup::handleReadReq(Signal* signal, * execute direct */ dst = &signal->theData[3]; - dstLen = (sizeof(signal->theData) / 4) - 3; + dstLen = (MAX_READ / 4) - 3; } if (regOperPtr->interpretedExec != 1) { @@ -1228,7 +1230,7 @@ int Dbtup::interpreterStartLab(Signal* signal, const BlockReference sendBref = regOperPtr->recBlockref; Uint32 * dst = &signal->theData[25]; - Uint32 dstLen = (sizeof(signal->theData) / 4) - 25; + Uint32 dstLen = (MAX_READ / 4) - 25; const Uint32 node = refToNode(sendBref); if(node != 0 && node != getOwnNodeId()) { ; @@ -1238,7 +1240,7 @@ int Dbtup::interpreterStartLab(Signal* signal, * execute direct */ dst = &signal->theData[3]; - dstLen = (sizeof(signal->theData) / 4) - 3; + dstLen = (MAX_READ / 4) - 3; } RtotalLen = RinitReadLen; diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index c011c1a6a2612859e0492cf7f824c8e1425fc384..51bc1e0b0556ee2772a1fd886880871dca740021 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -1128,6 +1128,7 @@ Ndb::sendPrepTrans(int forceSend) a_con->theCommitStatus = NdbConnection::Aborted; }//if }//if + a_con->theReturnStatus = NdbConnection::ReturnFailure; a_con->theCompletionStatus = NdbConnection::CompletedFailure; a_con->handleExecuteCompletion(); insert_completed_list(a_con); diff --git a/ndb/test/ndbapi/testTimeout.cpp b/ndb/test/ndbapi/testTimeout.cpp index e310e12df8136fe45231a0a7ab4c5d483a6606e5..ac4f257f12c5b7182533362992272ba76eea09aa 100644 --- a/ndb/test/ndbapi/testTimeout.cpp +++ b/ndb/test/ndbapi/testTimeout.cpp @@ -87,45 +87,6 @@ int runClearTable(NDBT_Context* ctx, NDBT_Step* step){ result = NDBT_FAILED; \ break; } -int runTimeoutTrans(NDBT_Context* ctx, NDBT_Step* step){ - int result = NDBT_OK; - int loops = ctx->getNumLoops(); - NdbConfig conf(GETNDB(step)->getNodeId()+1); - unsigned int nodeId = conf.getMasterNodeId(); - int stepNo = step->getStepNo(); - - int minSleep = (int)(TIMEOUT * 1.5); - int maxSleep = TIMEOUT * 2; - ndbout << "TransactionInactiveTimeout="<< TIMEOUT - << ", minSleep="<<minSleep - << ", maxSleep="<<maxSleep<<endl; - - HugoOperations hugoOps(*ctx->getTab()); - Ndb* pNdb = GETNDB(step); - - for (int l = 0; l < loops && result == NDBT_OK; l++){ - - do{ - // Commit transaction - CHECK(hugoOps.startTransaction(pNdb) == 0); - CHECK(hugoOps.pkReadRecord(pNdb, stepNo) == 0); - CHECK(hugoOps.execute_NoCommit(pNdb) == 0); - - int sleep = minSleep + myRandom48(maxSleep-minSleep); - ndbout << "Sleeping for " << sleep << " milliseconds" << endl; - NdbSleep_MilliSleep(sleep); - - // Expect that transaction has timed-out - CHECK(hugoOps.execute_Commit(pNdb) == 237); - - } while(false); - - hugoOps.closeTransaction(pNdb); - } - - return result; -} - int runTimeoutTrans2(NDBT_Context* ctx, NDBT_Step* step){ int result = NDBT_OK; int loops = ctx->getNumLoops(); @@ -345,27 +306,6 @@ TESTCASE("DontTimeoutTransaction5", FINALIZER(resetTransactionTimeout); FINALIZER(runClearTable); } -TESTCASE("TimeoutTransaction", - "Test that the transaction does timeout "\ - "if we sleep during the transaction. Use a sleep "\ - "value which is larger than TransactionInactiveTimeout"){ - INITIALIZER(runLoadTable); - INITIALIZER(setTransactionTimeout); - STEPS(runTimeoutTrans, 1); - FINALIZER(resetTransactionTimeout); - FINALIZER(runClearTable); -} -TESTCASE("TimeoutTransaction5", - "Test that the transaction does timeout " \ - "if we sleep during the transaction. Use a sleep " \ - "value which is larger than TransactionInactiveTimeout" \ - "Five simultaneous threads"){ - INITIALIZER(runLoadTable); - INITIALIZER(setTransactionTimeout); - STEPS(runTimeoutTrans, 5); - FINALIZER(resetTransactionTimeout); - FINALIZER(runClearTable); -} TESTCASE("TimeoutRandTransaction", "Test that the transaction does timeout "\ "if we sleep during the transaction. Use a sleep "\ diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index dce897663195f230ad1806f470536da825101f3c..6bb91dbb986b7f97ca8759cc271e9ee5f1a4b05a 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -147,34 +147,9 @@ max-time: 500 cmd: testBasic args: -n MassiveRollback2 T1 T6 T13 -#-m 500 1: testBasic -n ReadConsistency T6 max-time: 500 cmd: testTimeout -args: -n DontTimeoutTransaction T1 - -max-time: 500 -cmd: testTimeout -args: -n DontTimeoutTransaction5 T1 - -max-time: 500 -cmd: testTimeout -args: -n TimeoutTransaction T1 - -max-time: 500 -cmd: testTimeout -args: -n TimeoutTransaction5 T1 - -max-time: 500 -cmd: testTimeout -args: -n BuddyTransNoTimeout T1 - -max-time: 500 -cmd: testTimeout -args: -n BuddyTransNoTimeout5 T1 - -max-time: 500 -cmd: testTimeout -args: -n TimeoutRandTransaction T1 +args: T1 # SCAN TESTS #