Commit b6901868 authored by unknown's avatar unknown

Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/space/pekka/ndb/version/my41
parents 977d17e0 77e59f29
...@@ -607,8 +607,8 @@ private: ...@@ -607,8 +607,8 @@ private:
NdbOperation* theLastExecOpInList; // Last executing operation in list. NdbOperation* theLastExecOpInList; // Last executing operation in list.
NdbOperation* theCompletedFirstOp; // First operation in completed NdbOperation* theCompletedFirstOp; // First & last operation in completed
// operation list. NdbOperation* theCompletedLastOp; // operation list.
Uint32 theNoOfOpSent; // How many operations have been sent Uint32 theNoOfOpSent; // How many operations have been sent
Uint32 theNoOfOpCompleted; // How many operations have completed Uint32 theNoOfOpCompleted; // How many operations have completed
......
...@@ -55,6 +55,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : ...@@ -55,6 +55,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) :
theFirstExecOpInList(NULL), theFirstExecOpInList(NULL),
theLastExecOpInList(NULL), theLastExecOpInList(NULL),
theCompletedFirstOp(NULL), theCompletedFirstOp(NULL),
theCompletedLastOp(NULL),
theNoOfOpSent(0), theNoOfOpSent(0),
theNoOfOpCompleted(0), theNoOfOpCompleted(0),
theNoOfOpFetched(0), theNoOfOpFetched(0),
...@@ -124,6 +125,7 @@ NdbConnection::init() ...@@ -124,6 +125,7 @@ NdbConnection::init()
theLastExecOpInList = NULL; theLastExecOpInList = NULL;
theCompletedFirstOp = NULL; theCompletedFirstOp = NULL;
theCompletedLastOp = NULL;
theGlobalCheckpointId = 0; theGlobalCheckpointId = 0;
theCommitStatus = Started; theCommitStatus = Started;
...@@ -256,6 +258,8 @@ NdbConnection::handleExecuteCompletion() ...@@ -256,6 +258,8 @@ NdbConnection::handleExecuteCompletion()
if (tLastExecOp != NULL) { if (tLastExecOp != NULL) {
tLastExecOp->next(theCompletedFirstOp); tLastExecOp->next(theCompletedFirstOp);
theCompletedFirstOp = tFirstExecOp; theCompletedFirstOp = tFirstExecOp;
if (theCompletedLastOp == NULL)
theCompletedLastOp = tLastExecOp;
theFirstExecOpInList = NULL; theFirstExecOpInList = NULL;
theLastExecOpInList = NULL; theLastExecOpInList = NULL;
}//if }//if
...@@ -292,6 +296,8 @@ NdbConnection::execute(ExecType aTypeOfExec, ...@@ -292,6 +296,8 @@ NdbConnection::execute(ExecType aTypeOfExec,
ExecType tExecType; ExecType tExecType;
NdbOperation* tPrepOp; NdbOperation* tPrepOp;
NdbOperation* tCompletedFirstOp = NULL;
NdbOperation* tCompletedLastOp = NULL;
int ret = 0; int ret = 0;
do { do {
...@@ -314,6 +320,7 @@ NdbConnection::execute(ExecType aTypeOfExec, ...@@ -314,6 +320,7 @@ NdbConnection::execute(ExecType aTypeOfExec,
} }
tPrepOp = tPrepOp->next(); tPrepOp = tPrepOp->next();
} }
// save rest of prepared ops if batch // save rest of prepared ops if batch
NdbOperation* tRestOp= 0; NdbOperation* tRestOp= 0;
NdbOperation* tLastOp= 0; NdbOperation* tLastOp= 0;
...@@ -323,6 +330,7 @@ NdbConnection::execute(ExecType aTypeOfExec, ...@@ -323,6 +330,7 @@ NdbConnection::execute(ExecType aTypeOfExec,
tLastOp = theLastOpInList; tLastOp = theLastOpInList;
theLastOpInList = tPrepOp; theLastOpInList = tPrepOp;
} }
if (tExecType == Commit) { if (tExecType == Commit) {
NdbOperation* tOp = theCompletedFirstOp; NdbOperation* tOp = theCompletedFirstOp;
while (tOp != NULL) { while (tOp != NULL) {
...@@ -338,6 +346,19 @@ NdbConnection::execute(ExecType aTypeOfExec, ...@@ -338,6 +346,19 @@ NdbConnection::execute(ExecType aTypeOfExec,
} }
} }
// completed ops are in unspecified order
if (theCompletedFirstOp != NULL) {
if (tCompletedFirstOp == NULL) {
tCompletedFirstOp = theCompletedFirstOp;
tCompletedLastOp = theCompletedLastOp;
} else {
tCompletedLastOp->next(theCompletedFirstOp);
tCompletedLastOp = theCompletedLastOp;
}
theCompletedFirstOp = NULL;
theCompletedLastOp = NULL;
}
if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) if (executeNoBlobs(tExecType, abortOption, forceSend) == -1)
ret = -1; ret = -1;
#ifndef VM_TRACE #ifndef VM_TRACE
...@@ -362,6 +383,7 @@ NdbConnection::execute(ExecType aTypeOfExec, ...@@ -362,6 +383,7 @@ NdbConnection::execute(ExecType aTypeOfExec,
tOp = tOp->next(); tOp = tOp->next();
} }
} }
// add saved prepared ops if batch // add saved prepared ops if batch
if (tPrepOp != NULL && tRestOp != NULL) { if (tPrepOp != NULL && tRestOp != NULL) {
if (theFirstOpInList == NULL) if (theFirstOpInList == NULL)
...@@ -373,6 +395,18 @@ NdbConnection::execute(ExecType aTypeOfExec, ...@@ -373,6 +395,18 @@ NdbConnection::execute(ExecType aTypeOfExec,
assert(theFirstOpInList == NULL || tExecType == NoCommit); assert(theFirstOpInList == NULL || tExecType == NoCommit);
} while (theFirstOpInList != NULL || tExecType != aTypeOfExec); } while (theFirstOpInList != NULL || tExecType != aTypeOfExec);
if (tCompletedFirstOp != NULL) {
tCompletedLastOp->next(theCompletedFirstOp);
theCompletedFirstOp = tCompletedFirstOp;
if (theCompletedLastOp == NULL)
theCompletedLastOp = tCompletedLastOp;
}
#if ndb_api_count_completed_ops_after_blob_execute
{ NdbOperation* tOp; unsigned n = 0;
for (tOp = theCompletedFirstOp; tOp != NULL; tOp = tOp->next()) n++;
ndbout << "completed ops: " << n << endl;
}
#endif
DBUG_RETURN(ret); DBUG_RETURN(ret);
} }
...@@ -894,6 +928,7 @@ NdbConnection::releaseOperations() ...@@ -894,6 +928,7 @@ NdbConnection::releaseOperations()
releaseOps(theFirstExecOpInList); releaseOps(theFirstExecOpInList);
theCompletedFirstOp = NULL; theCompletedFirstOp = NULL;
theCompletedLastOp = NULL;
theFirstOpInList = NULL; theFirstOpInList = NULL;
theFirstExecOpInList = NULL; theFirstExecOpInList = NULL;
theLastOpInList = NULL; theLastOpInList = NULL;
...@@ -909,6 +944,7 @@ NdbConnection::releaseCompletedOperations() ...@@ -909,6 +944,7 @@ NdbConnection::releaseCompletedOperations()
{ {
releaseOps(theCompletedFirstOp); releaseOps(theCompletedFirstOp);
theCompletedFirstOp = NULL; theCompletedFirstOp = NULL;
theCompletedLastOp = NULL;
}//NdbConnection::releaseOperations() }//NdbConnection::releaseOperations()
/****************************************************************************** /******************************************************************************
......
This diff is collapsed.
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