List:Commits« Previous MessageNext Message »
From:jonas Date:September 15 2006 4:28pm
Subject:bk commit into 5.0 tree (jonas:1.2251) BUG#21941
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jonas. When jonas 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@stripped, 2006-09-15 16:28:38+02:00, jonas@stripped +3 -0
  ndb - bug#21941
    Fix so that scans closed before execute are removed from "scans to send list"

  ndb/include/ndbapi/NdbTransaction.hpp@stripped, 2006-09-15 16:28:36+02:00,
jonas@stripped +4 -1
    Fix so that scans closed before execute are removed from "scans to send list"

  ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2006-09-15 16:28:36+02:00,
jonas@stripped +20 -2
    Fix so that scans closed before execute are removed from "scans to send list"

  ndb/src/ndbapi/NdbTransaction.cpp@stripped, 2006-09-15 16:28:36+02:00,
jonas@stripped +48 -17
    Fix so that scans closed before execute are removed from "scans to send list"

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/50-work

--- 1.43/ndb/include/ndbapi/NdbTransaction.hpp	2006-09-15 16:28:41 +02:00
+++ 1.44/ndb/include/ndbapi/NdbTransaction.hpp	2006-09-15 16:28:41 +02:00
@@ -657,8 +657,11 @@
   // Release all cursor operations in connection
   void releaseOps(NdbOperation*);	
   void releaseScanOperations(NdbIndexScanOperation*);	
+  bool releaseScanOperation(NdbIndexScanOperation** listhead,
+			    NdbIndexScanOperation** listtail,
+			    NdbIndexScanOperation* op);
   void releaseExecutedScanOperation(NdbIndexScanOperation*);
-
+  
   // Set the transaction identity of the transaction
   void		setTransactionId(Uint64 aTransactionId);
 

--- 1.48/ndb/src/ndbapi/NdbTransaction.cpp	2006-09-15 16:28:41 +02:00
+++ 1.49/ndb/src/ndbapi/NdbTransaction.cpp	2006-09-15 16:28:41 +02:00
@@ -978,27 +978,58 @@
 NdbTransaction::releaseExecutedScanOperation(NdbIndexScanOperation* cursorOp)
 {
   DBUG_ENTER("NdbTransaction::releaseExecutedScanOperation");
-  DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp))
+  DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp));
+  
+  releaseScanOperation(&m_firstExecutedScanOp, 0, cursorOp);
+  
+  DBUG_VOID_RETURN;
+}//NdbTransaction::releaseExecutedScanOperation()
 
-  // here is one reason to make op lists doubly linked
-  if (m_firstExecutedScanOp == cursorOp) {
-    m_firstExecutedScanOp = (NdbIndexScanOperation*)cursorOp->theNext;
-    cursorOp->release();
-    theNdb->releaseScanOperation(cursorOp);
-  } else if (m_firstExecutedScanOp != NULL) {
-    NdbIndexScanOperation* tOp = m_firstExecutedScanOp;
-    while (tOp->theNext != NULL) {
-      if (tOp->theNext == cursorOp) {
-        tOp->theNext = cursorOp->theNext;
-        cursorOp->release();
-        theNdb->releaseScanOperation(cursorOp);
-        break;
+bool
+NdbTransaction::releaseScanOperation(NdbIndexScanOperation** listhead,
+				     NdbIndexScanOperation** listtail,
+				     NdbIndexScanOperation* op)
+{
+  if (* listhead == op)
+  {
+    * listhead = (NdbIndexScanOperation*)op->theNext;
+    if (listtail && *listtail == op)
+    {
+      assert(* listhead == 0);
+      * listtail = 0;
+    }
+      
+  }
+  else
+  {
+    NdbIndexScanOperation* tmp = * listhead;
+    while (tmp != NULL)
+    {
+      if (tmp->theNext == op)
+      {
+	tmp->theNext = (NdbIndexScanOperation*)op->theNext;
+	if (listtail && *listtail == op)
+	{
+	  assert(op->theNext == 0);
+	  *listtail = tmp;
+	}
+	break;
       }
-      tOp = (NdbIndexScanOperation*)tOp->theNext;
+      tmp = (NdbIndexScanOperation*)tmp->theNext;
     }
+    if (tmp == NULL)
+      op = NULL;
   }
-  DBUG_VOID_RETURN;
-}//NdbTransaction::releaseExecutedScanOperation()
+  
+  if (op != NULL)
+  {
+    op->release();
+    theNdb->releaseScanOperation(op);
+    return true;
+  }
+  
+  return false;
+}
 
 /*****************************************************************************
 NdbOperation* getNdbOperation(const char* aTableName);

--- 1.76/ndb/src/ndbapi/NdbScanOperation.cpp	2006-09-15 16:28:41 +02:00
+++ 1.77/ndb/src/ndbapi/NdbScanOperation.cpp	2006-09-15 16:28:41 +02:00
@@ -678,9 +678,27 @@
   theNdbCon = NULL;
   m_transConnection = NULL;
 
-  if (releaseOp && tTransCon) {
+  if (tTransCon) 
+  {
     NdbIndexScanOperation* tOp = (NdbIndexScanOperation*)this;
-    tTransCon->releaseExecutedScanOperation(tOp);
+
+    bool ret = true;
+    if (theStatus != WaitResponse)
+    {
+      /**
+       * Not executed yet
+       */
+      ret = 
+	tTransCon->releaseScanOperation(&tTransCon->m_theFirstScanOperation,
+					&tTransCon->m_theLastScanOperation,
+					tOp);
+    }
+    else if (releaseOp)
+    {
+      ret = tTransCon->releaseScanOperation(&tTransCon->m_firstExecutedScanOp,
+					    0, tOp);
+    }
+    assert(ret);
   }
   
   tCon->theScanningOp = 0;
Thread
bk commit into 5.0 tree (jonas:1.2251) BUG#21941jonas15 Sep