MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Pekka Nousiainen Date:March 16 2009 6:33pm
Subject:bzr commit into mysql-5.0-bugteam branch (pekka:2774) Bug#32040
View as plain text  
#At file:///export/space/pekka/ndb/version/my50-bug32040/

 2774 Pekka Nousiainen	2009-03-16
      bug#32040 01_dbtux.diff
      scanNext: if Locked, try to unlock instead of crashing
      committed for easy access but not pushed at this time
      not tested since cannot reproduce the bug
      modified:
        ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp

=== modified file 'ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp'
--- a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp	2008-02-22 15:36:09 +0000
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp	2009-03-16 18:33:16 +0000
@@ -814,8 +814,6 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool 
     debugOut << "Enter next scan " << scanPtr.i << " " << scan << endl;
   }
 #endif
-  // cannot be moved away from tuple we have locked
-  ndbrequire(scan.m_state != ScanOp::Locked);
   // set up index keys for this operation
   setKeyAttrs(frag);
   // scan direction
@@ -827,6 +825,24 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool 
   NodeHandle origNode(frag);
   selectNode(origNode, pos.m_loc);
   ndbrequire(islinkScan(origNode, scanPtr));
+  if (scan.m_state == ScanOp::Locked) {
+    // bug#32040 - no fix, just unlock and continue
+    jam();
+    if (scan.m_accLockOp != RNIL) {
+      jam();
+      Signal* signal = &globalData.VMSignals[0]; // ugly
+      AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend();
+      lockReq->returnCode = RNIL;
+      lockReq->requestInfo = AccLockReq::Abort;
+      lockReq->accOpPtr = scan.m_accLockOp;
+      EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ, signal, AccLockReq::UndoSignalLength);
+      jamEntry();
+      ndbrequire(lockReq->returnCode == AccLockReq::Success);
+      scan.m_accLockOp = RNIL;
+      scan.m_lockwait = false;
+    }
+    scan.m_state = ScanOp::Next;
+  }
   // current node in loop
   NodeHandle node = origNode;
   // copy of entry found

Thread
bzr commit into mysql-5.0-bugteam branch (pekka:2774) Bug#32040Pekka Nousiainen16 Mar