summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-20 12:54:23 +0100
committerunknown <joreland@mysql.com>2004-12-20 12:54:23 +0100
commit143014349dd55754800464cc1f262b16a6cf2b58 (patch)
tree8d973af3dabb1972573eeb3cbdcd3c7af012ab67
parentf52ba350fa8bb8a6cea6deec74241962c4b7828f (diff)
downloadmariadb-git-143014349dd55754800464cc1f262b16a6cf2b58.tar.gz
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
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp10
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp1
-rw-r--r--ndb/test/ndbapi/testTimeout.cpp60
-rw-r--r--ndb/test/run-test/daily-basic-tests.txt27
4 files changed, 8 insertions, 90 deletions
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 8e3ca6528c2..cb5477a1551 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 c011c1a6a26..51bc1e0b055 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 e310e12df81..ac4f257f12c 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 dce89766319..6bb91dbb986 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
#