Commit 14301434 authored by unknown's avatar unknown

ndb - bug fixes for autotest


ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Fix handling reading of more that MAX_MESSAGE_SIZE
ndb/src/ndbapi/Ndbif.cpp:
  Set theReturnStatus if failing before sending
ndb/test/ndbapi/testTimeout.cpp:
  remove invalid tests
ndb/test/run-test/daily-basic-tests.txt:
  remove invalid tests
parent f52ba350
......@@ -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;
......
......@@ -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);
......
......@@ -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 "\
......
......@@ -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
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment