List:Internals« Previous MessageNext Message »
From:Stewart Smith Date:August 25 2005 6:05am
Subject:bk commit into 5.0 tree (stewart:1.1894) BUG#11607
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1894 05/08/25 16:04:48 stewart@stripped +1 -0
  BUG#11607 error 4350 on deleletion
  
  Fix so that the correct error is returned to the user.

  ndb/src/ndbapi/NdbTransaction.cpp
    1.45 05/08/25 16:04:39 stewart@stripped +18 -2
    Save error on first failure.
    
    At end of execute, if the current error is 4350 (transaction already aborted), restore
    the original error (if there was one).

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stewart
# Host:	kennedy.(none)
# Root:	/home/stewart/Documents/MySQL/5.0/bug11607

--- 1.44/ndb/src/ndbapi/NdbTransaction.cpp	2005-06-02 22:32:01 +10:00
+++ 1.45/ndb/src/ndbapi/NdbTransaction.cpp	2005-08-25 16:04:39 +10:00
@@ -264,10 +264,13 @@
 		       AbortOption abortOption,
 		       int forceSend)
 {
+  NdbError savedError;
   DBUG_ENTER("NdbTransaction::execute");
   DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d", 
 		       aTypeOfExec, abortOption));
 
+  savedError.code= 0;
+
   if (! theBlobFlag)
     DBUG_RETURN(executeNoBlobs(aTypeOfExec, abortOption, forceSend));
 
@@ -295,6 +298,8 @@
           if (tBlob->preExecute(tExecType, batch) == -1)
             ret = -1;
           tBlob = tBlob->theNext;
+	  if(ret<0 && savedError.code==0)
+	    savedError= theError;
         }
         if (batch) {
           // blob asked to execute all up to here now
@@ -322,8 +327,10 @@
           NdbBlob* tBlob = tOp->theBlobList;
           while (tBlob != NULL) {
             if (tBlob->preCommit() == -1)
-              ret = -1;
+	      ret = -1;
             tBlob = tBlob->theNext;
+	    if(ret<0 && savedError.code==0)
+	      savedError= theError;
           }
         }
         tOp = tOp->next();
@@ -344,7 +351,10 @@
     }
 
     if (executeNoBlobs(tExecType, abortOption, forceSend) == -1)
-        ret = -1;
+      ret = -1;
+    if(ret<0 && savedError.code==0)
+      savedError= theError;
+
 #ifdef ndb_api_crash_on_complex_blob_abort
     assert(theFirstOpInList == NULL && theLastOpInList == NULL);
 #else
@@ -361,6 +371,8 @@
             if (tBlob->postExecute(tExecType) == -1)
               ret = -1;
             tBlob = tBlob->theNext;
+	    if(ret<0 && savedError.code==0)
+	      savedError= theError;
           }
         }
         tOp = tOp->next();
@@ -390,6 +402,10 @@
     ndbout << "completed ops: " << n << endl;
   }
 #endif
+
+  if(savedError.code!=0 && theError.code==4350) // Trans already aborted
+      theError= savedError;
+
   DBUG_RETURN(ret);
 }
 
Thread
bk commit into 5.0 tree (stewart:1.1894) BUG#11607Stewart Smith25 Aug