Commit b4e568b6 authored by unknown's avatar unknown

Merge mysql.com:/home/stewart/Documents/MySQL/4.1/bug11607

into  mysql.com:/home/stewart/Documents/MySQL/5.0/bug11607


ndb/src/ndbapi/NdbTransaction.cpp:
  SCCS merged
parents 7bdc8e8f 49d10fb9
...@@ -264,6 +264,7 @@ NdbTransaction::execute(ExecType aTypeOfExec, ...@@ -264,6 +264,7 @@ NdbTransaction::execute(ExecType aTypeOfExec,
AbortOption abortOption, AbortOption abortOption,
int forceSend) int forceSend)
{ {
NdbError savedError= theError;
DBUG_ENTER("NdbTransaction::execute"); DBUG_ENTER("NdbTransaction::execute");
DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d", DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d",
aTypeOfExec, abortOption)); aTypeOfExec, abortOption));
...@@ -293,7 +294,11 @@ NdbTransaction::execute(ExecType aTypeOfExec, ...@@ -293,7 +294,11 @@ NdbTransaction::execute(ExecType aTypeOfExec,
NdbBlob* tBlob = tPrepOp->theBlobList; NdbBlob* tBlob = tPrepOp->theBlobList;
while (tBlob != NULL) { while (tBlob != NULL) {
if (tBlob->preExecute(tExecType, batch) == -1) if (tBlob->preExecute(tExecType, batch) == -1)
{
ret = -1; ret = -1;
if(savedError.code==0)
savedError= theError;
}
tBlob = tBlob->theNext; tBlob = tBlob->theNext;
} }
if (batch) { if (batch) {
...@@ -322,7 +327,11 @@ NdbTransaction::execute(ExecType aTypeOfExec, ...@@ -322,7 +327,11 @@ NdbTransaction::execute(ExecType aTypeOfExec,
NdbBlob* tBlob = tOp->theBlobList; NdbBlob* tBlob = tOp->theBlobList;
while (tBlob != NULL) { while (tBlob != NULL) {
if (tBlob->preCommit() == -1) if (tBlob->preCommit() == -1)
ret = -1; {
ret = -1;
if(savedError.code==0)
savedError= theError;
}
tBlob = tBlob->theNext; tBlob = tBlob->theNext;
} }
} }
...@@ -344,7 +353,12 @@ NdbTransaction::execute(ExecType aTypeOfExec, ...@@ -344,7 +353,12 @@ NdbTransaction::execute(ExecType aTypeOfExec,
} }
if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) if (executeNoBlobs(tExecType, abortOption, forceSend) == -1)
ret = -1; {
ret = -1;
if(savedError.code==0)
savedError= theError;
}
#ifdef ndb_api_crash_on_complex_blob_abort #ifdef ndb_api_crash_on_complex_blob_abort
assert(theFirstOpInList == NULL && theLastOpInList == NULL); assert(theFirstOpInList == NULL && theLastOpInList == NULL);
#else #else
...@@ -359,7 +373,11 @@ NdbTransaction::execute(ExecType aTypeOfExec, ...@@ -359,7 +373,11 @@ NdbTransaction::execute(ExecType aTypeOfExec,
while (tBlob != NULL) { while (tBlob != NULL) {
// may add new operations if batch // may add new operations if batch
if (tBlob->postExecute(tExecType) == -1) if (tBlob->postExecute(tExecType) == -1)
{
ret = -1; ret = -1;
if(savedError.code==0)
savedError= theError;
}
tBlob = tBlob->theNext; tBlob = tBlob->theNext;
} }
} }
...@@ -390,6 +408,10 @@ NdbTransaction::execute(ExecType aTypeOfExec, ...@@ -390,6 +408,10 @@ NdbTransaction::execute(ExecType aTypeOfExec,
ndbout << "completed ops: " << n << endl; ndbout << "completed ops: " << n << endl;
} }
#endif #endif
if(savedError.code!=0 && theError.code==4350) // Trans already aborted
theError= savedError;
DBUG_RETURN(ret); DBUG_RETURN(ret);
} }
......
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