List:Commits« Previous MessageNext Message »
From:Martin Skold Date:June 12 2006 12:36pm
Subject:bk commit into 5.1 tree (mskold:1.2184)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty 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.2184 06/06/12 14:36:06 mskold@stripped +4 -0
  Merge mskold@stripped:/home/bk/mysql-5.1
  into  mysql.com:/home/marty/MySQL/mysql-5.1

  storage/ndb/src/ndbapi/ndberror.c
    1.61 06/06/12 14:35:56 mskold@stripped +0 -0
    Auto merged

  storage/ndb/src/ndbapi/NdbScanOperation.cpp
    1.83 06/06/12 14:35:56 mskold@stripped +0 -0
    Auto merged

  storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
    1.60 06/06/12 14:35:56 mskold@stripped +0 -0
    Auto merged

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
    1.140 06/06/12 14:35:55 mskold@stripped +0 -0
    Auto merged

# 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:	mskold
# Host:	linux.site
# Root:	/home/marty/MySQL/mysql-5.1/RESYNC

--- 1.82/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2006-06-09 11:39:20 +02:00
+++ 1.83/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2006-06-12 14:35:56 +02:00
@@ -162,7 +162,7 @@ NdbScanOperation::readTuples(NdbScanOper
     return -1;
   }
 
-  m_keyInfo = lockExcl ? 1 : 0;
+  m_keyInfo = ((scan_flags & SF_KeyInfo) || lockExcl) ? 1 : 0;
   bool tupScan = (scan_flags & SF_TupScan);
 
 #if 1 // XXX temp for testing
@@ -950,6 +950,12 @@ NdbScanOperation::takeOverScanOp(Operati
     if (newOp == NULL){
       return NULL;
     }
+    if (!m_keyInfo)
+    {
+      // Cannot take over lock if no keyinfo was requested
+      setErrorCodeAbort(4604);
+      return NULL;
+    }
     pTrans->theSimpleState = 0;
     
     assert(tRecAttr->get_size_in_bytes() > 0);
@@ -958,12 +964,16 @@ NdbScanOperation::takeOverScanOp(Operati
     
     newOp->theTupKeyLen = len;
     newOp->theOperationType = opType;
-    if (opType == DeleteRequest) {
-      newOp->theStatus = GetValue;  
-    } else {
-      newOp->theStatus = SetValue;  
+    switch (opType) {
+    case (ReadRequest):
+      newOp->theLockMode = theLockMode;
+      // Fall through
+    case (DeleteRequest):
+      newOp->theStatus = GetValue;
+      break;
+    default:
+      newOp->theStatus = SetValue;
     }
-    
     const Uint32 * src = (Uint32*)tRecAttr->aRef();
     const Uint32 tScanInfo = src[len] & 0x3FFFF;
     const Uint32 tTakeOverFragment = src[len] >> 20;

--- 1.60/storage/ndb/src/ndbapi/ndberror.c	2006-06-09 12:29:56 +02:00
+++ 1.61/storage/ndb/src/ndbapi/ndberror.c	2006-06-12 14:35:56 +02:00
@@ -308,7 +308,7 @@ ErrorBundle ErrorCodes[] = {
   { 4601, DMEC, AE, "Transaction is not started"},
   { 4602, DMEC, AE, "You must call getNdbOperation before executeScan" },
   { 4603, DMEC, AE, "There can only be ONE operation in a scan transaction" },
-  { 4604, DMEC, AE, "takeOverScanOp, opType must be UpdateRequest or DeleteRequest" },
+  { 4604, DMEC, AE, "takeOverScanOp, to take over a scanned row one must explicitly request keyinfo on readTuples call" },
   { 4605, DMEC, AE, "You may only call openScanRead or openScanExclusive once for each operation"},
   { 4607, DMEC, AE, "There may only be one operation in a scan transaction"},
   { 4608, DMEC, AE, "You can not takeOverScan unless you have used openScanExclusive"},
Thread
bk commit into 5.1 tree (mskold:1.2184)Martin Skold12 Jun