List:Commits« Previous MessageNext Message »
From:knielsen Date:April 25 2007 3:06pm
Subject:bk commit into 5.1 tree (knielsen:1.2479)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of knielsen. When knielsen 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, 2007-04-25 15:06:03+02:00, knielsen@ymer.(none) +5 -0
  Merge bk-internal:/home/bk/mysql-5.1-new-ndb
  into  ymer.(none):/usr/local/mysql/mysql-5.1-new-ndb
  MERGE: 1.2469.188.2

  storage/ndb/include/ndbapi/NdbOperation.hpp@stripped, 2007-04-25 15:05:56+02:00,
knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.42.1.1

  storage/ndb/include/ndbapi/NdbScanOperation.hpp@stripped, 2007-04-25 15:05:56+02:00,
knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.49.1.1

  storage/ndb/src/ndbapi/NdbOperationDefine.cpp@stripped, 2007-04-25 15:05:56+02:00,
knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.29.1.1

  storage/ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2007-04-25 15:05:56+02:00,
knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.112.1.2

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-04-25 15:05:56+02:00,
knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.77.1.1

# 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:	knielsen
# Host:	ymer.(none)
# Root:	/usr/local/mysql/mysql-5.1-new-ndb/RESYNC

--- 1.80/storage/ndb/test/run-test/daily-basic-tests.txt	2007-04-25 15:06:10 +02:00
+++ 1.81/storage/ndb/test/run-test/daily-basic-tests.txt	2007-04-25 15:06:10 +02:00
@@ -708,6 +708,14 @@ max-time: 1500
 cmd: testBlobs
 args:
 
+max-time: 600
+cmd: testBlobs
+args: -bug 27018
+
+max-time: 600
+cmd: testBlobs
+args: -bug 27370
+
 max-time: 5000
 cmd: testOIBasic
 args: -case abcdefz

--- 1.43/storage/ndb/include/ndbapi/NdbOperation.hpp	2007-04-25 15:06:10 +02:00
+++ 1.44/storage/ndb/include/ndbapi/NdbOperation.hpp	2007-04-25 15:06:10 +02:00
@@ -949,6 +949,8 @@ protected:
   // get table or index key from prepared signals
   int getKeyFromTCREQ(Uint32* data, Uint32 & size);
 
+  virtual void setReadLockMode(LockMode lockMode);
+
 /******************************************************************************
  * These are the private variables that are defined in the operation objects.
  *****************************************************************************/

--- 1.50/storage/ndb/include/ndbapi/NdbScanOperation.hpp	2007-04-25 15:06:10 +02:00
+++ 1.51/storage/ndb/include/ndbapi/NdbScanOperation.hpp	2007-04-25 15:06:10 +02:00
@@ -214,6 +214,7 @@ protected:
   int init(const NdbTableImpl* tab, NdbTransaction*);
   int prepareSend(Uint32  TC_ConnectPtr, Uint64  TransactionId);
   int doSend(int ProcessorId);
+  virtual void setReadLockMode(LockMode lockMode);
 
   virtual void setErrorCode(int aErrorCode);
   virtual void setErrorCodeAbort(int aErrorCode);

--- 1.30/storage/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-04-25 15:06:10 +02:00
+++ 1.31/storage/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-04-25 15:06:10 +02:00
@@ -333,6 +333,36 @@ NdbOperation::interpretedDeleteTuple()
   }//if
 }//NdbOperation::interpretedDeleteTuple()
 
+void
+NdbOperation::setReadLockMode(LockMode lockMode)
+{
+  /* We only support changing lock mode for read operations at this time. */
+  assert(theOperationType == ReadRequest || theOperationType == ReadExclusive);
+  switch (lockMode)
+  {
+    case LM_CommittedRead:
+      theOperationType= ReadRequest;
+      theSimpleIndicator= 1;
+      theDirtyIndicator= 1;
+      break;
+    case LM_Read:
+      theNdbCon->theSimpleState= 0;
+      theOperationType= ReadRequest;
+      theSimpleIndicator= 0;
+      theDirtyIndicator= 0;
+      break;
+    case LM_Exclusive:
+      theNdbCon->theSimpleState= 0;
+      theOperationType= ReadExclusive;
+      theSimpleIndicator= 0;
+      theDirtyIndicator= 0;
+      break;
+    default:
+      /* Not supported / invalid. */
+      assert(false);
+  }
+  theLockMode= lockMode;
+}
 
 
 /******************************************************************************

--- 1.114/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-04-25 15:06:10 +02:00
+++ 1.115/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-04-25 15:06:10 +02:00
@@ -138,34 +138,9 @@ NdbScanOperation::readTuples(NdbScanOper
   }
 
   theNdbCon->theScanningOp = this;
-  theLockMode = lm;
-
-  bool lockExcl, lockHoldMode, readCommitted;
-  switch(lm){
-  case NdbScanOperation::LM_Read:
-    lockExcl = false;
-    lockHoldMode = true;
-    readCommitted = false;
-    break;
-  case NdbScanOperation::LM_Exclusive:
-    lockExcl = true;
-    lockHoldMode = true;
-    readCommitted = false;
-    break;
-  case NdbScanOperation::LM_CommittedRead:
-    lockExcl = false;
-    lockHoldMode = false;
-    readCommitted = true;
-    break;
-  default:
-    setErrorCode(4003);
-    return -1;
-  }
-
-  m_keyInfo = ((scan_flags & SF_KeyInfo) || lockExcl) ? 1 : 0;
   bool tupScan = (scan_flags & SF_TupScan);
 
-#if 1 // XXX temp for testing
+#if 0 // XXX temp for testing
   { char* p = getenv("NDB_USE_TUPSCAN");
     if (p != 0) {
       unsigned n = atoi(p); // 0-10
@@ -225,13 +200,13 @@ NdbScanOperation::readTuples(NdbScanOper
   Uint32 reqInfo = 0;
   ScanTabReq::setParallelism(reqInfo, parallel);
   ScanTabReq::setScanBatch(reqInfo, 0);
-  ScanTabReq::setLockMode(reqInfo, lockExcl);
-  ScanTabReq::setHoldLockFlag(reqInfo, lockHoldMode);
-  ScanTabReq::setReadCommittedFlag(reqInfo, readCommitted);
   ScanTabReq::setRangeScanFlag(reqInfo, rangeScan);
   ScanTabReq::setTupScanFlag(reqInfo, tupScan);
   req->requestInfo = reqInfo;
 
+  m_keyInfo = (scan_flags & SF_KeyInfo) ? 1 : 0;
+  setReadLockMode(lm);
+
   Uint64 transId = theNdbCon->getTransactionId();
   req->transId1 = (Uint32) transId;
   req->transId2 = (Uint32) (transId >> 32);
@@ -249,6 +224,41 @@ NdbScanOperation::readTuples(NdbScanOper
 
   getFirstATTRINFOScan();
   return 0;
+}
+
+void
+NdbScanOperation::setReadLockMode(LockMode lockMode)
+{
+  bool lockExcl, lockHoldMode, readCommitted;
+  switch (lockMode)
+  {
+    case LM_CommittedRead:
+      lockExcl= false;
+      lockHoldMode= false;
+      readCommitted= true;
+      break;
+    case LM_Read:
+      lockExcl= false;
+      lockHoldMode= true;
+      readCommitted= false;
+      break;
+    case LM_Exclusive:
+      lockExcl= true;
+      lockHoldMode= true;
+      readCommitted= false;
+      m_keyInfo= 1;
+      break;
+    default:
+      /* Not supported / invalid. */
+      assert(false);
+  }
+  theLockMode= lockMode;
+  ScanTabReq *req= CAST_PTR(ScanTabReq, theSCAN_TABREQ->getDataPtrSend());
+  Uint32 reqInfo= req->requestInfo;
+  ScanTabReq::setLockMode(reqInfo, lockExcl);
+  ScanTabReq::setHoldLockFlag(reqInfo, lockHoldMode);
+  ScanTabReq::setReadCommittedFlag(reqInfo, readCommitted);
+  req->requestInfo= reqInfo;
 }
 
 int
Thread
bk commit into 5.1 tree (knielsen:1.2479)knielsen25 Apr