List:Commits« Previous MessageNext Message »
From:knielsen Date:February 8 2007 1:08pm
Subject:bk commit into 5.1 tree (knielsen:1.2431)
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-02-08 14:08:50+01:00, knielsen@ymer.(none) +17 -0
  Merge bk-internal:/home/bk/mysql-5.1-new-ndb
  into  ymer.(none):/usr/local/mysql/mysql-5.1-wl2223
  MERGE: 1.2372.2.16

  storage/ndb/include/ndbapi/NdbDictionary.hpp@stripped, 2007-02-08 13:07:32+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.85.1.2

  storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp@stripped, 2007-02-08 13:07:32+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.27.1.1

  storage/ndb/include/ndbapi/NdbOperation.hpp@stripped, 2007-02-08 13:07:32+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.39.1.2

  storage/ndb/include/ndbapi/NdbReceiver.hpp@stripped, 2007-02-08 13:07:32+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.16.1.2

  storage/ndb/include/ndbapi/NdbScanOperation.hpp@stripped, 2007-02-08 14:08:47+01:00, knielsen@ymer.(none) +3 -2
    Manual merge
    MERGE: 1.44.1.3

  storage/ndb/include/ndbapi/NdbTransaction.hpp@stripped, 2007-02-08 13:07:32+01:00, knielsen@ymer.(none) +0 -1
    Auto merged
    MERGE: 1.52.1.2

  storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.131.1.2

  storage/ndb/src/ndbapi/Ndb.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.83.1.2

  storage/ndb/src/ndbapi/NdbDictionary.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.64.1.3

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.157.1.2

  storage/ndb/src/ndbapi/NdbIndexOperation.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.28.1.3

  storage/ndb/src/ndbapi/NdbOperationDefine.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.25.2.1

  storage/ndb/src/ndbapi/NdbOperationExec.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.23.1.4

  storage/ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.103.1.6

  storage/ndb/src/ndbapi/NdbTransaction.cpp@stripped, 2007-02-08 14:08:47+01:00, knielsen@ymer.(none) +2 -2
    Manual merge.
    MERGE: 1.66.1.9

  storage/ndb/src/ndbapi/ndberror.c@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.81.1.1

  storage/ndb/tools/select_all.cpp@stripped, 2007-02-08 13:07:33+01:00, knielsen@ymer.(none) +0 -0
    Auto merged
    MERGE: 1.27.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-wl2223/RESYNC

--- 1.29/storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp	2007-02-08 14:08:57 +01:00
+++ 1.30/storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp	2007-02-08 14:08:57 +01:00
@@ -64,12 +64,14 @@ public:
                         bool order_by,
                         bool order_desc = false,
                         bool read_range_no = false,
-			bool keyinfo = false) {
+			bool keyinfo = false,
+			bool multi_range = false) {
     Uint32 scan_flags =
       (SF_OrderBy & -(Int32)order_by) |
       (SF_Descending & -(Int32)order_desc) |
       (SF_ReadRangeNo & -(Int32)read_range_no) | 
-      (SF_KeyInfo & -(Int32)keyinfo);
+      (SF_KeyInfo & -(Int32)keyinfo) |
+      (SF_MultiRange & -(Int32)multi_range);
     
     return readTuples(lock_mode, scan_flags, parallel, batch);
   }

--- 1.57/storage/ndb/include/ndbapi/NdbTransaction.hpp	2007-02-08 14:08:57 +01:00
+++ 1.58/storage/ndb/include/ndbapi/NdbTransaction.hpp	2007-02-08 14:08:57 +01:00
@@ -45,11 +45,12 @@ typedef void (* NdbAsynchCallback)(int, 
 
 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
 enum AbortOption {
-  CommitIfFailFree= 0,         
-  TryCommit= 0,
-  AbortOnError= 0,
-  CommitAsMuchAsPossible= 2,
-  AO_IgnoreError= 2
+  DefaultAbortOption = NdbOperation::DefaultAbortOption,
+  CommitIfFailFree = NdbOperation::AbortOnError,         
+  TryCommit = NdbOperation::AbortOnError,
+  AbortOnError= NdbOperation::AbortOnError,
+  CommitAsMuchAsPossible = NdbOperation::AO_IgnoreError,
+  AO_IgnoreError= NdbOperation::AO_IgnoreError
 };
 enum ExecType { 
   NoExecTypeDef = -1,
@@ -148,20 +149,6 @@ class NdbTransaction
 public:
 
   /**
-   * Commit type of transaction
-   */
-  enum AbortOption {
-    AbortOnError=               ///< Abort transaction on failed operation
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
-    ::AbortOnError
-#endif
-    ,AO_IgnoreError=            ///< Transaction continues on failed operation
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
-    ::AO_IgnoreError
-#endif
-  };
-
-  /**
    * Execution type of transaction
    */
   enum ExecType {
@@ -319,13 +306,15 @@ public:
    * @return 0 if successful otherwise -1.
    */
   int execute(ExecType execType,
-	      AbortOption abortOption = AbortOnError,
+	      NdbOperation::AbortOption = NdbOperation::DefaultAbortOption,
 	      int force = 0 );
 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
   int execute(::ExecType execType,
-	      ::AbortOption abortOption = ::AbortOnError,
-	      int force = 0 )
-  { return execute ((ExecType)execType,(AbortOption)abortOption,force); }
+	      ::AbortOption abortOption = ::DefaultAbortOption,
+	      int force = 0 ) {
+    return execute ((ExecType)execType,
+		    (NdbOperation::AbortOption)abortOption,
+		    force); }
 #endif
 
 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
@@ -356,14 +345,14 @@ public:
   void executeAsynchPrepare(ExecType          execType,
 			    NdbAsynchCallback callback,
 			    void*             anyObject,
-			    AbortOption abortOption = AbortOnError);
+			    NdbOperation::AbortOption = NdbOperation::DefaultAbortOption);
 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
   void executeAsynchPrepare(::ExecType       execType,
 			    NdbAsynchCallback callback,
 			    void*             anyObject,
-			    ::AbortOption abortOption = ::AbortOnError)
-  { executeAsynchPrepare((ExecType)execType, callback, anyObject,
-			 (AbortOption)abortOption); }
+			    ::AbortOption ao = ::DefaultAbortOption) {
+    executeAsynchPrepare((ExecType)execType, callback, anyObject,
+			 (NdbOperation::AbortOption)ao); }
 #endif
 
   /**
@@ -382,14 +371,14 @@ public:
   void executeAsynch(ExecType            aTypeOfExec,
 		     NdbAsynchCallback   aCallback,
 		     void*               anyObject,
-		     AbortOption abortOption = AbortOnError);
+		     NdbOperation::AbortOption = NdbOperation::DefaultAbortOption);
 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
   void executeAsynch(::ExecType         aTypeOfExec,
 		     NdbAsynchCallback   aCallback,
 		     void*               anyObject,
-		     ::AbortOption abortOption= ::AbortOnError)
+		     ::AbortOption abortOption= ::DefaultAbortOption)
   { executeAsynch((ExecType)aTypeOfExec, aCallback, anyObject,
-		  (AbortOption)abortOption); }
+		  (NdbOperation::AbortOption)abortOption); }
 #endif
 #endif
   /**
@@ -691,7 +680,7 @@ private:						
   void init();           // Initialize connection object for new transaction
 
   int executeNoBlobs(ExecType execType, 
-	             AbortOption abortOption = AbortOnError,
+	             NdbOperation::AbortOption = NdbOperation::DefaultAbortOption,
 	             int force = 0 );
   
   /**
@@ -745,7 +734,7 @@ private:						
   int 	sendCOMMIT();                   // Send a TC_COMMITREQ signal;
   void	setGCI(int GCI);		// Set the global checkpoint identity
  
-  int	OpCompleteFailure(Uint8 abortoption, bool setFailure = true);
+  int	OpCompleteFailure(NdbOperation*);
   int	OpCompleteSuccess();
   void	CompletedOperations();	        // Move active ops to list of completed
  
@@ -837,7 +826,6 @@ private:						
 
   Uint32	theNoOfOpSent;				// How many operations have been sent	    
   Uint32	theNoOfOpCompleted;			// How many operations have completed
-  Uint32        theNoOfOpFetched;           	        // How many operations was actually fetched
   Uint32	theMyRef;				// Our block reference		
   Uint32	theTCConPtr;				// Transaction Co-ordinator connection pointer.
   Uint64	theTransactionId;			// theTransactionId of the transaction
@@ -861,7 +849,6 @@ private:						
   bool theTransactionIsStarted; 
   bool theInUseState;
   bool theSimpleState;
-  Uint8 m_abortOption;           // Type of commi
 
   enum ListState {  
     NotInList, 

--- 1.90/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-02-08 14:08:57 +01:00
+++ 1.91/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-02-08 14:08:57 +01:00
@@ -812,9 +812,9 @@ public:
      */
     void setMaxLoadFactor(int);
 
-    void setTablespace(const char * name);
+    void setTablespaceName(const char * name);
+    const char * getTablespaceName() const;
     void setTablespace(const class Tablespace &);
-    const char * getTablespace() const;
     bool getTablespace(Uint32 *id= 0, Uint32 *version= 0) const;
 
     /**

--- 1.43/storage/ndb/include/ndbapi/NdbOperation.hpp	2007-02-08 14:08:57 +01:00
+++ 1.44/storage/ndb/include/ndbapi/NdbOperation.hpp	2007-02-08 14:08:57 +01:00
@@ -100,6 +100,19 @@ public:
   };
 
   /**
+   * How should transaction be handled if operation fails
+   *
+   * For READ, default is AO_IgnoreError
+   *     DML,  default is AbortOnError
+   * CommittedRead does _only_ support AO_IgnoreError
+   */
+  enum AbortOption {
+    DefaultAbortOption = -1,///< Use default as specified by op-type
+    AbortOnError = 0,       ///< Abort transaction on failed operation
+    AO_IgnoreError = 2      ///< Transaction continues on failed operation
+  };
+
+  /**
    * Define the NdbOperation to be a standard operation of type insertTuple.
    * When calling NdbTransaction::execute, this operation 
    * adds a new tuple to the table.
@@ -780,8 +793,13 @@ public:
    */
   LockMode getLockMode() const { return theLockMode; }
 
+  /**
+   * Get/set abort option
+   */
+  AbortOption getAbortOption() const;
+  int setAbortOption(AbortOption);
+  
 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
-  void setAbortOption(Int8 ao) { m_abortOption = ao; }
   
   /**
    * Set/get partition key
@@ -918,7 +936,8 @@ protected:
 
   int    doSend(int ProcessorId, Uint32 lastFlag);
   virtual int	 prepareSend(Uint32  TC_ConnectPtr,
-                             Uint64  TransactionId);
+                             Uint64  TransactionId,
+			     AbortOption);
   virtual void   setLastFlag(NdbApiSignal* signal, Uint32 lastFlag);
     
   int	 prepareSendInterpreted();            // Help routine to prepare*

--- 1.20/storage/ndb/include/ndbapi/NdbReceiver.hpp	2007-02-08 14:08:57 +01:00
+++ 1.21/storage/ndb/include/ndbapi/NdbReceiver.hpp	2007-02-08 14:08:57 +01:00
@@ -58,7 +58,7 @@ public:
   
   bool checkMagicNumber() const;
 
-  inline void next(NdbReceiver* next) { m_next = next;}
+  inline void next(NdbReceiver* next_arg) { m_next = next_arg;}
   inline NdbReceiver* next() { return m_next; }
   
   void setErrorCode(int);

--- 1.46/storage/ndb/include/ndbapi/NdbScanOperation.hpp	2007-02-08 14:08:57 +01:00
+++ 1.47/storage/ndb/include/ndbapi/NdbScanOperation.hpp	2007-02-08 14:08:57 +01:00
@@ -39,7 +39,8 @@ class NdbScanOperation : public NdbOpera
 public:
   /**
    * Scan flags.  OR-ed together and passed as second argument to
-   * readTuples.
+   * readTuples. Note that SF_MultiRange has to be set if several
+   * ranges (bounds) are to be passed.
    */
   enum ScanFlag {
     /* Scan TUP order */
@@ -62,6 +63,8 @@ public:
       explanation.
     */
     SF_ReadRangeNo = (4 << 24),
+    /* Scan is part of multi-range scan. */
+    SF_MultiRange = (8 << 24),
     /*
       Request KeyInfo to be sent back.
       This enables the option to take over row lock taken by the scan using
@@ -97,7 +100,8 @@ public:
    */ 
 #ifdef ndb_readtuples_impossible_overload
   int readTuples(LockMode lock_mode = LM_Read, 
-		 Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false);
+		 Uint32 batch = 0, Uint32 parallel = 0, 
+                 bool keyinfo = false, bool multi_range = false);
 #endif
   
   inline int readTuples(int parallell){
@@ -395,6 +399,7 @@ protected:
     Then the 'real' columns that are participating in the scan.    
   */
   NdbRecAttr *m_curr_row;
+  bool m_multi_range; // Mark if operation is part of multi-range scan
   bool m_executed; // Marker if operation should be released at close
 };
 

--- 1.132/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-02-08 14:08:57 +01:00
+++ 1.133/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-02-08 14:08:57 +01:00
@@ -2522,7 +2522,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
   ApiConnectRecord * const regApiPtr = &localApiConnectRecord[TapiIndex];
   apiConnectptr.p = regApiPtr;
 
-  Uint32 TstartFlag = tcKeyReq->getStartFlag(Treqinfo);
+  Uint32 TstartFlag = TcKeyReq::getStartFlag(Treqinfo);
   Uint32 TexecFlag = TcKeyReq::getExecuteFlag(Treqinfo);
 
   Uint8 isIndexOp = regApiPtr->isIndexOp;
@@ -2692,14 +2692,14 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
   /*                                                                        */
   /* ---------------------------------------------------------------------- */
 
-  UintR TapiVersionNo = tcKeyReq->getAPIVersion(tcKeyReq->attrLen);
+  UintR TapiVersionNo = TcKeyReq::getAPIVersion(tcKeyReq->attrLen);
   UintR Tlqhkeyreqrec = regApiPtr->lqhkeyreqrec;
   regApiPtr->lqhkeyreqrec = Tlqhkeyreqrec + 1;
   regCachePtr->apiVersionNo = TapiVersionNo;
 
   UintR TapiConnectptrIndex = apiConnectptr.i;
   UintR TsenderData = tcKeyReq->senderData;
-  UintR TattrLen = tcKeyReq->getAttrinfoLen(tcKeyReq->attrLen);
+  UintR TattrLen = TcKeyReq::getAttrinfoLen(tcKeyReq->attrLen);
   UintR TattrinfoCount = c_counters.cattrinfoCount;
 
   regTcPtr->apiConnect = TapiConnectptrIndex;
@@ -2725,15 +2725,15 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
 
   UintR TtabptrIndex = localTabptr.i;
   UintR TtableSchemaVersion = tcKeyReq->tableSchemaVersion;
-  Uint8 TOperationType = tcKeyReq->getOperationType(Treqinfo);
+  Uint8 TOperationType = TcKeyReq::getOperationType(Treqinfo);
   regCachePtr->tableref = TtabptrIndex;
   regCachePtr->schemaVersion = TtableSchemaVersion;
   regTcPtr->operation = TOperationType;
 
-  Uint8 TSimpleFlag         = tcKeyReq->getSimpleFlag(Treqinfo);
-  Uint8 TDirtyFlag          = tcKeyReq->getDirtyFlag(Treqinfo);
-  Uint8 TInterpretedFlag    = tcKeyReq->getInterpretedFlag(Treqinfo);
-  Uint8 TDistrKeyFlag       = tcKeyReq->getDistributionKeyFlag(Treqinfo);
+  Uint8 TSimpleFlag         = TcKeyReq::getSimpleFlag(Treqinfo);
+  Uint8 TDirtyFlag          = TcKeyReq::getDirtyFlag(Treqinfo);
+  Uint8 TInterpretedFlag    = TcKeyReq::getInterpretedFlag(Treqinfo);
+  Uint8 TDistrKeyFlag       = TcKeyReq::getDistributionKeyFlag(Treqinfo);
   Uint8 TNoDiskFlag         = TcKeyReq::getNoDiskFlag(Treqinfo);
   Uint8 TexecuteFlag        = TexecFlag;
   
@@ -2749,10 +2749,10 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
   Uint32 TkeyIndex;
   Uint32* TOptionalDataPtr = (Uint32*)&tcKeyReq->scanInfo;
   {
-    Uint32  TDistrGHIndex    = tcKeyReq->getScanIndFlag(Treqinfo);
+    Uint32  TDistrGHIndex    = TcKeyReq::getScanIndFlag(Treqinfo);
     Uint32  TDistrKeyIndex   = TDistrGHIndex;
 
-    Uint32 TscanInfo = tcKeyReq->getTakeOverScanInfo(TOptionalDataPtr[0]);
+    Uint32 TscanInfo = TcKeyReq::getTakeOverScanInfo(TOptionalDataPtr[0]);
 
     regCachePtr->scanTakeOverInd = TDistrGHIndex;
     regCachePtr->scanInfo = TscanInfo;
@@ -2774,7 +2774,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
   regCachePtr->keydata[2] = Tdata3;
   regCachePtr->keydata[3] = Tdata4;
 
-  TkeyLength = tcKeyReq->getKeyLength(Treqinfo);
+  TkeyLength = TcKeyReq::getKeyLength(Treqinfo);
   Uint32 TAIDataIndex;
   if (TkeyLength > 8) {
     TAIDataIndex = TkeyIndex + 8;
@@ -2787,7 +2787,7 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
   }//if
   Uint32* TAIDataPtr = &TOptionalDataPtr[TAIDataIndex];
 
-  titcLenAiInTckeyreq = tcKeyReq->getAIInTcKeyReq(Treqinfo);
+  titcLenAiInTckeyreq = TcKeyReq::getAIInTcKeyReq(Treqinfo);
   regCachePtr->keylen = TkeyLength;
   regCachePtr->lenAiInTckeyreq = titcLenAiInTckeyreq;
   regCachePtr->currReclenAi = titcLenAiInTckeyreq;
@@ -2824,6 +2824,12 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
         tmp.p->apiNodeId     = refToNode(regApiPtr->ndbapiBlockref);
         tmp.p->apiConnectPtr = TapiIndex;
         tmp.p->noOfLqhs      = 0;
+#if defined VM_TRACE || defined ERROR_INSERT
+	{
+	  CommitAckMarkerPtr check;
+	  ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
+	}
+#endif
         m_commitAckMarkerHash.add(tmp);
       }
     }
@@ -2852,14 +2858,14 @@ void Dbtc::execTCKEYREQ(Signal* signal) 
     }//switch
   }//if
   
-  Uint32 TabortOption = tcKeyReq->getAbortOption(Treqinfo);
+  Uint32 TabortOption = TcKeyReq::getAbortOption(Treqinfo);
   regTcPtr->m_execAbortOption = TabortOption;
   
   /*-------------------------------------------------------------------------
    * Check error handling per operation
    * If CommitFlag is set state accordingly and check for early abort
    *------------------------------------------------------------------------*/
-  if (tcKeyReq->getCommitFlag(Treqinfo) == 1) {
+  if (TcKeyReq::getCommitFlag(Treqinfo) == 1) {
     ndbrequire(TexecuteFlag);
     regApiPtr->apiConnectstate = CS_REC_COMMITTING;
   } else {
@@ -8114,6 +8120,13 @@ void Dbtc::initApiConnectFail(Signal* si
     tmp.p->noOfLqhs      = 1;
     tmp.p->lqhNodeId[0]  = tnodeid;
     tmp.p->apiConnectPtr = apiConnectptr.i;
+
+#if defined VM_TRACE || defined ERROR_INSERT
+    {
+      CommitAckMarkerPtr check;
+      ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
+    }
+#endif
     m_commitAckMarkerHash.add(tmp);
   } 
 }//Dbtc::initApiConnectFail()
@@ -8270,6 +8283,12 @@ void Dbtc::updateApiStateFail(Signal* si
       tmp.p->noOfLqhs      = 1;
       tmp.p->lqhNodeId[0]  = tnodeid;
       tmp.p->apiConnectPtr = apiConnectptr.i;
+#if defined VM_TRACE || defined ERROR_INSERT
+      {
+	CommitAckMarkerPtr check;
+	ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
+      }
+#endif
       m_commitAckMarkerHash.add(tmp);
     } else {
       jam();
@@ -11470,7 +11489,7 @@ void Dbtc::execTCINDXREQ(Signal* signal)
   // If operation is readTupleExclusive or updateTuple then read index 
   // table with exclusive lock
   Uint32 indexLength = TcKeyReq::getKeyLength(tcIndxRequestInfo);
-  Uint32 attrLength = tcIndxReq->attrLen;
+  Uint32 attrLength = TcKeyReq::getAttrinfoLen(tcIndxReq->attrLen);
   indexOp->expectedKeyInfo = indexLength;
   Uint32 includedIndexLength = MIN(indexLength, indexBufSize);
   indexOp->expectedAttrInfo = attrLength;

--- 1.84/storage/ndb/src/ndbapi/Ndb.cpp	2007-02-08 14:08:57 +01:00
+++ 1.85/storage/ndb/src/ndbapi/Ndb.cpp	2007-02-08 14:08:57 +01:00
@@ -255,8 +255,6 @@ Ndb::waitUntilReady(int timeout)
   DBUG_ENTER("Ndb::waitUntilReady");
   int secondsCounter = 0;
   int milliCounter = 0;
-  int noChecksSinceFirstAliveFound = 0;
-  int id;
 
   if (theInitState != Initialised) {
     // Ndb::init is not called
@@ -1083,7 +1081,7 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* 
       tOperation->incValue("NEXTID", opValue);
       tRecAttrResult = tOperation->getValue("NEXTID");
 
-      if (tConnection->execute( Commit ) == -1 )
+      if (tConnection->execute( NdbTransaction::Commit ) == -1 )
         goto error_handler;
 
       tValue = tRecAttrResult->u_64_value();
@@ -1098,7 +1096,7 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* 
       tOperation->equal("SYSKEY_0", aTableId );
       tOperation->setValue("NEXTID", opValue);
 
-      if (tConnection->execute( Commit ) == -1 )
+      if (tConnection->execute( NdbTransaction::Commit ) == -1 )
         goto error_handler;
 
       range.reset();
@@ -1115,7 +1113,7 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* 
       tOperation->def_label(0);
       tOperation->interpret_exit_nok(9999);
       
-      if (tConnection->execute( Commit ) == -1)
+      if (tConnection->execute( NdbTransaction::Commit ) == -1)
       {
         if (tConnection->theError.code != 9999)
           goto error_handler;
@@ -1132,7 +1130,7 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* 
       tOperation->readTuple();
       tOperation->equal("SYSKEY_0", aTableId );
       tRecAttrResult = tOperation->getValue("NEXTID");
-      if (tConnection->execute( Commit ) == -1 )
+      if (tConnection->execute( NdbTransaction::Commit ) == -1 )
         goto error_handler;
       opValue = tRecAttrResult->u_64_value(); // out
       break;

--- 1.73/storage/ndb/src/ndbapi/NdbTransaction.cpp	2007-02-08 14:08:57 +01:00
+++ 1.74/storage/ndb/src/ndbapi/NdbTransaction.cpp	2007-02-08 14:08:57 +01:00
@@ -58,7 +58,6 @@ NdbTransaction::NdbTransaction( Ndb* aNd
   theCompletedLastOp(NULL),
   theNoOfOpSent(0),
   theNoOfOpCompleted(0),
-  theNoOfOpFetched(0),
   theMyRef(0),
   theTCConPtr(0),
   theTransactionId(0),
@@ -133,7 +132,6 @@ NdbTransaction::init()
     theNdb->theImpl->m_ndb_cluster_connection.get_latest_trans_gci();
   theCommitStatus         = Started;
   theCompletionStatus     = NotCompleted;
-  m_abortOption           = AbortOnError;
 
   theError.code		  = 0;
   theErrorLine		  = 0;
@@ -178,12 +176,9 @@ void
 NdbTransaction::setOperationErrorCodeAbort(int error, int abortOption)
 {
   DBUG_ENTER("NdbTransaction::setOperationErrorCodeAbort");
-  if (abortOption == -1)
-    abortOption = m_abortOption;
   if (theTransactionIsStarted == false) {
     theCommitStatus = Aborted;
-  } else if ((abortOption == AbortOnError) && 
-	     (theCommitStatus != Committed) &&
+  } else if ((theCommitStatus != Committed) &&
              (theCommitStatus != Aborted)) {
     theCommitStatus = NeedAbort;
   }//if
@@ -265,8 +260,8 @@ Remark:        Initialise connection obj
 *****************************************************************************/
 int 
 NdbTransaction::execute(ExecType aTypeOfExec, 
-		       AbortOption abortOption,
-		       int forceSend)
+			NdbOperation::AbortOption abortOption,
+			int forceSend)
 {
   NdbError savedError= theError;
   DBUG_ENTER("NdbTransaction::execute");
@@ -356,40 +351,14 @@ NdbTransaction::execute(ExecType aTypeOf
       theCompletedLastOp = NULL;
     }
 
-    if (executeNoBlobs(tExecType, abortOption, forceSend) == -1)
+    if (executeNoBlobs(tExecType, 
+		       NdbOperation::DefaultAbortOption,
+		       forceSend) == -1)
     {
-      ret = -1;
       if(savedError.code==0)
 	savedError= theError;
       
-      /**
-       * If AO_IgnoreError, error codes arent always set on individual
-       *   operations, making postExecute impossible
-       */
-      if (abortOption == AO_IgnoreError)
-      {
-         if (theCompletedFirstOp != NULL)
-	 {
-	   if (tCompletedFirstOp != NULL)
-	   {
-	     tCompletedLastOp->next(theCompletedFirstOp);
-	     theCompletedFirstOp = tCompletedFirstOp;
-	   } 
-	 }
-	 else
-	 {
-	   theCompletedFirstOp = tCompletedFirstOp;
-	   theCompletedLastOp = tCompletedLastOp;
-	 }
-         if (tPrepOp != NULL && tRestOp != NULL) {
-           if (theFirstOpInList == NULL)
-             theFirstOpInList = tRestOp;
-           else
-             theLastOpInList->next(tRestOp);
-           theLastOpInList = tLastOp;
-        }
-	DBUG_RETURN(-1);
-      }
+      DBUG_RETURN(-1);
     }
     
 #ifdef ndb_api_crash_on_complex_blob_abort
@@ -449,9 +418,9 @@ NdbTransaction::execute(ExecType aTypeOf
 }
 
 int 
-NdbTransaction::executeNoBlobs(ExecType aTypeOfExec, 
-                              AbortOption abortOption,
-                              int forceSend)
+NdbTransaction::executeNoBlobs(NdbTransaction::ExecType aTypeOfExec, 
+			       NdbOperation::AbortOption abortOption,
+			       int forceSend)
 {
   DBUG_ENTER("NdbTransaction::executeNoBlobs");
   DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d", 
@@ -529,10 +498,10 @@ Parameters :   aTypeOfExec:   Type of ex
 Remark:        Prepare a part of a transaction in an asynchronous manner. 
 *****************************************************************************/
 void 
-NdbTransaction::executeAsynchPrepare( ExecType           aTypeOfExec,
+NdbTransaction::executeAsynchPrepare(NdbTransaction::ExecType aTypeOfExec,
                                      NdbAsynchCallback  aCallback,
                                      void*              anyObject,
-                                     AbortOption abortOption)
+                                     NdbOperation::AbortOption abortOption)
 {
   DBUG_ENTER("NdbTransaction::executeAsynchPrepare");
   DBUG_PRINT("enter", ("aTypeOfExec: %d, aCallback: 0x%lx, anyObject: Ox%lx",
@@ -574,7 +543,6 @@ NdbTransaction::executeAsynchPrepare( Ex
   theReturnStatus     = ReturnSuccess;
   theCallbackFunction = aCallback;
   theCallbackObject   = anyObject;
-  m_abortOption   = abortOption;
   m_waitForReply = true;
   tNdb->thePreparedTransactionsArray[tnoOfPreparedTransactions] = this;
   theTransArrayIndex = tnoOfPreparedTransactions;
@@ -673,7 +641,7 @@ NdbTransaction::executeAsynchPrepare( Ex
     if (tOp->Status() == NdbOperation::UseNdbRecord)
       tReturnCode= tOp->prepareSendNdbRecord(theTCConPtr, theTransactionId);
     else
-      tReturnCode= tOp->prepareSend(theTCConPtr, theTransactionId);
+      tReturnCode= tOp->prepareSend(theTCConPtr, theTransactionId, abortOption);
 
     if (tReturnCode == -1) {
       theSendStatus = sendABORTfail;
@@ -1811,14 +1779,8 @@ from other transactions.
       }
     } else if ((tNoComp >= tNoSent) &&
                (theLastExecOpInList->theCommitIndicator == 1)){
-
-
-      if (m_abortOption == AO_IgnoreError && theError.code != 0){
-	/**
-	 * There's always a TCKEYCONF when using IgnoreError
-	 */
-	return -1;
-      }
+      
+      
 /**********************************************************************/
 // We sent the transaction with Commit flag set and received a CONF with
 // no Commit flag set. This is clearly an anomaly.
@@ -1992,13 +1954,6 @@ NdbTransaction::receiveTCINDXCONF(const 
     } else if ((tNoComp >= tNoSent) &&
                (theLastExecOpInList->theCommitIndicator == 1)){
 
-      if (m_abortOption == AO_IgnoreError && theError.code != 0){
-	/**
-	 * There's always a TCKEYCONF when using IgnoreError
-	 */
-	return -1;
-      }
-
       /**********************************************************************/
       // We sent the transaction with Commit flag set and received a CONF with
       // no Commit flag set. This is clearly an anomaly.
@@ -2022,41 +1977,6 @@ NdbTransaction::receiveTCINDXCONF(const 
   return -1;
 }//NdbTransaction::receiveTCINDXCONF()
 
-/*****************************************************************************
-int receiveTCINDXREF( NdbApiSignal* aSignal)
-
-Return Value:   Return 0 : send was succesful.
-                Return -1: In all other case.   
-Parameters:     aSignal: the signal object that contains the 
-                TCINDXREF signal from TC.
-Remark:         Handles the reception of the TCINDXREF signal.
-*****************************************************************************/
-int
-NdbTransaction::receiveTCINDXREF( NdbApiSignal* aSignal)
-{
-  if(checkState_TransId(aSignal->getDataPtr()+1)){
-    theError.code = aSignal->readData(4);	// Override any previous errors
-
-    /**********************************************************************/
-    /*	A serious error has occured. This could be due to deadlock or */
-    /*	lack of resources or simply a programming error in NDB. This  */
-    /*	transaction will be aborted. Actually it has already been     */
-    /*	and we only need to report completion and return with the     */
-    /*	error code to the application.				      */
-    /**********************************************************************/
-    theCompletionStatus = NdbTransaction::CompletedFailure;
-    theCommitStatus = NdbTransaction::Aborted;
-    theReturnStatus = NdbTransaction::ReturnFailure;
-    return 0;
-  } else {
-#ifdef NDB_NO_DROPPED_SIGNAL
-    abort();
-#endif
-  }
-
-  return -1;
-}//NdbTransaction::receiveTCINDXREF()
-
 /*******************************************************************************
 int OpCompletedFailure();
 
@@ -2066,36 +1986,15 @@ Parameters:    aErrorCode: The error cod
 Remark:        An operation was completed with failure.
 *******************************************************************************/
 int 
-NdbTransaction::OpCompleteFailure(Uint8 abortOption, bool setFailure)
+NdbTransaction::OpCompleteFailure(NdbOperation* op)
 {
   Uint32 tNoComp = theNoOfOpCompleted;
   Uint32 tNoSent = theNoOfOpSent;
-  if (setFailure)
-    theCompletionStatus = NdbTransaction::CompletedFailure;
+
   tNoComp++;
   theNoOfOpCompleted = tNoComp;
-  if (tNoComp == tNoSent) {
-    //------------------------------------------------------------------------
-    //If the transaction consists of only simple reads we can set
-    //Commit state Aborted.  Otherwise this simple operation cannot
-    //decide the success of the whole transaction since a simple
-    //operation is not really part of that transaction.
-    //------------------------------------------------------------------------
-    if (abortOption == AO_IgnoreError){
-      /**
-       * There's always a TCKEYCONF when using IgnoreError
-       */
-      return -1;
-    }
-    
-    return 0;	// Last operation received
-  } else if (tNoComp > tNoSent) {
-    setOperationErrorCodeAbort(4113);	// Too many operations, 
-                                        // stop waiting for more
-    return 0;
-  } else {
-    return -1;	// Continue waiting for more signals
-  }//if
+  
+  return (tNoComp == tNoSent) ? 0 : -1;
 }//NdbTransaction::OpCompleteFailure()
 
 /******************************************************************************

--- 1.70/storage/ndb/src/ndbapi/NdbDictionary.cpp	2007-02-08 14:08:57 +01:00
+++ 1.71/storage/ndb/src/ndbapi/NdbDictionary.cpp	2007-02-08 14:08:57 +01:00
@@ -663,8 +663,14 @@ NdbDictionary::Table::getTablespace(Uint
   return true;
 }
 
+const char *
+NdbDictionary::Table::getTablespaceName() const 
+{
+  return m_impl.m_tablespace_name.c_str();
+}
+
 void 
-NdbDictionary::Table::setTablespace(const char * name){
+NdbDictionary::Table::setTablespaceName(const char * name){
   m_impl.m_tablespace_id = ~0;
   m_impl.m_tablespace_version = ~0;
   m_impl.m_tablespace_name.assign(name);

--- 1.159/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-02-08 14:08:57 +01:00
+++ 1.160/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-02-08 14:08:57 +01:00
@@ -2904,7 +2904,6 @@ int
 NdbDictionaryImpl::dropTableGlobal(NdbTableImpl & impl)
 {
   int res;
-  const char * name = impl.getName();
   DBUG_ENTER("NdbDictionaryImpl::dropTableGlobal");
   DBUG_ASSERT(impl.m_status != NdbDictionary::Object::New);
   DBUG_ASSERT(impl.m_indexType == NdbDictionary::Object::TypeUndefined);
@@ -4277,8 +4276,6 @@ void
 NdbDictInterface::execWAIT_GCP_CONF(NdbApiSignal* signal,
 				    LinearSectionPtr ptr[3])
 {
-  const WaitGCPConf * const conf=
-    CAST_CONSTPTR(WaitGCPConf, signal->getDataPtr());
   m_waiter.signal(NO_WAIT);
 }
 

--- 1.30/storage/ndb/src/ndbapi/NdbIndexOperation.cpp	2007-02-08 14:08:57 +01:00
+++ 1.31/storage/ndb/src/ndbapi/NdbIndexOperation.cpp	2007-02-08 14:08:57 +01:00
@@ -172,239 +172,6 @@ NdbIndexOperation::getIndex() const
   return m_theIndex;
 }
 
-int 
-NdbIndexOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64  aTransactionId)
-{
-  Uint32 tTransId1, tTransId2;
-  Uint32 tReqInfo;
-  Uint32 tSignalCount = 0;
-  Uint32 tInterpretInd = theInterpretIndicator;
-  
-  theErrorLine = 0;
-
-  if (tInterpretInd != 1) {
-    OperationType tOpType = theOperationType;
-    OperationStatus tStatus = theStatus;
-    if ((tOpType == UpdateRequest) ||
-         (tOpType == InsertRequest) ||
-         (tOpType == WriteRequest)) {
-      if (tStatus != SetValue) {
-        setErrorCodeAbort(4506);
-        return -1;
-      }//if
-    } else if ((tOpType == ReadRequest) || (tOpType == ReadExclusive) ||
-         (tOpType == DeleteRequest)) {
-      if (tStatus != GetValue) {
-        setErrorCodeAbort(4506);
-        return -1;
-      }//if
-    } else {
-      setErrorCodeAbort(4507);      
-      return -1;
-    }//if
-  } else {
-    if (prepareSendInterpreted() == -1) {
-      return -1;
-    }//if
-  }//if
-  
-//-------------------------------------------------------------
-// We start by filling in the first 8 unconditional words of the
-// TCINDXREQ signal.
-//-------------------------------------------------------------
-  TcKeyReq * tcKeyReq = 
-    CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend());
-
-  Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len;
-  Uint32 tIndexId = m_theIndex->m_id;
-  Uint32 tSchemaVersion = m_theIndex->m_version;
-  
-  tcKeyReq->apiConnectPtr      = aTC_ConnectPtr;
-  tcKeyReq->senderData         = ptr2int();
-  tcKeyReq->attrLen            = tTotalCurrAI_Len;
-  tcKeyReq->tableId            = tIndexId;
-  tcKeyReq->tableSchemaVersion = tSchemaVersion;
-
-  tTransId1 = (Uint32) aTransactionId;
-  tTransId2 = (Uint32) (aTransactionId >> 32);
-  
-//-------------------------------------------------------------
-// Simple is simple if simple or both start and commit is set.
-//-------------------------------------------------------------
-// Temporarily disable simple stuff
-  Uint8 tSimpleIndicator = 0;
-//  Uint8 tSimpleIndicator = theSimpleIndicator;
-  Uint8 tCommitIndicator = theCommitIndicator;
-  Uint8 tStartIndicator = theStartIndicator;
-//  if ((theNdbCon->theLastOpInList == this) && (theCommitIndicator == 0))
-//    abort();
-// Temporarily disable simple stuff
-  Uint8 tSimpleAlt = 0;
-//  Uint8 tSimpleAlt = tStartIndicator & tCommitIndicator;
-  tSimpleIndicator = tSimpleIndicator | tSimpleAlt;
-
-//-------------------------------------------------------------
-// Simple state is set if start and commit is set and it is
-// a read request. Otherwise it is set to zero.
-//-------------------------------------------------------------
-  Uint8 tReadInd = (theOperationType == ReadRequest);
-  Uint8 tSimpleState = tReadInd & tSimpleAlt;
-  //theNdbCon->theSimpleState = tSimpleState;
-
-  tcKeyReq->transId1           = tTransId1;
-  tcKeyReq->transId2           = tTransId2;
-  
-  tReqInfo = 0;
-
-  if (tTotalCurrAI_Len <= TcKeyReq::MaxAttrInfo) {
-    tcKeyReq->setAIInTcKeyReq(tReqInfo, tTotalCurrAI_Len);
-  } else {
-    tcKeyReq->setAIInTcKeyReq(tReqInfo, TcKeyReq::MaxAttrInfo);
-  }//if
-
-  tcKeyReq->setSimpleFlag(tReqInfo, tSimpleIndicator);
-  tcKeyReq->setCommitFlag(tReqInfo, tCommitIndicator);
-  tcKeyReq->setStartFlag(tReqInfo, tStartIndicator);
-  const Uint8 tInterpretIndicator = theInterpretIndicator;
-  tcKeyReq->setInterpretedFlag(tReqInfo, tInterpretIndicator);
-
-  Uint8 tDirtyIndicator = theDirtyIndicator;
-  OperationType tOperationType = theOperationType;
-  Uint32 tIndexLen = theTupKeyLen;
-  Uint8 abortOption = theNdbCon->m_abortOption;
-
-  tcKeyReq->setDirtyFlag(tReqInfo, tDirtyIndicator);
-  tcKeyReq->setOperationType(tReqInfo, tOperationType);
-  tcKeyReq->setKeyLength(tReqInfo, tIndexLen);
-  tcKeyReq->setAbortOption(tReqInfo, abortOption);
-  
-  Uint8 tDistrKeyIndicator = theDistrKeyIndicator_;
-  Uint8 tScanIndicator = theScanInfo & 1;
-
-  tcKeyReq->setDistributionKeyFlag(tReqInfo, tDistrKeyIndicator);
-  tcKeyReq->setScanIndFlag(tReqInfo, tScanIndicator);
-
-  tcKeyReq->requestInfo  = tReqInfo;
-
-//-------------------------------------------------------------
-// The next step is to fill in the upto three conditional words.
-//-------------------------------------------------------------
-  Uint32* tOptionalDataPtr = &tcKeyReq->scanInfo;
-  Uint32 tDistrGHIndex = tScanIndicator;
-  Uint32 tDistrKeyIndex = tDistrGHIndex;
-
-  Uint32 tScanInfo = theScanInfo;
-  Uint32 tDistrKey = theDistributionKey;
-
-  tOptionalDataPtr[0] = tScanInfo;
-  tOptionalDataPtr[tDistrKeyIndex] = tDistrKey;
-
-//-------------------------------------------------------------
-// The next is step is to compress the key data part of the
-// TCKEYREQ signal.
-//-------------------------------------------------------------
-  Uint32 tKeyIndex = tDistrKeyIndex + tDistrKeyIndicator;
-  Uint32* tKeyDataPtr = &tOptionalDataPtr[tKeyIndex];
-  Uint32 Tdata1 = tcKeyReq->keyInfo[0];
-  Uint32 Tdata2 = tcKeyReq->keyInfo[1];
-  Uint32 Tdata3 = tcKeyReq->keyInfo[2];
-  Uint32 Tdata4 = tcKeyReq->keyInfo[3];
-  Uint32 Tdata5;
-
-  tKeyDataPtr[0] = Tdata1;
-  tKeyDataPtr[1] = Tdata2;
-  tKeyDataPtr[2] = Tdata3;
-  tKeyDataPtr[3] = Tdata4;
-  if (tIndexLen > 4) {
-    Tdata1 = tcKeyReq->keyInfo[4];
-    Tdata2 = tcKeyReq->keyInfo[5];
-    Tdata3 = tcKeyReq->keyInfo[6];
-    Tdata4 = tcKeyReq->keyInfo[7];
-
-    tKeyDataPtr[4] = Tdata1;
-    tKeyDataPtr[5] = Tdata2;
-    tKeyDataPtr[6] = Tdata3;
-    tKeyDataPtr[7] = Tdata4;
-  }//if
-//-------------------------------------------------------------
-// Finally we also compress the INDXATTRINFO part of the signal.
-// We optimise by using the if-statement for sending INDXKEYINFO
-// signals to calculating the new Attrinfo Index.
-//-------------------------------------------------------------
-  Uint32 tAttrInfoIndex;  
-
-  if (tIndexLen > TcKeyReq::MaxKeyInfo) {
-    /**
-     *	Set transid and TC connect ptr in the INDXKEYINFO signals
-     */
-    NdbApiSignal* tSignal = theTCREQ->next();
-    Uint32 remainingKey = tIndexLen - TcKeyReq::MaxKeyInfo;
-
-    do {
-      Uint32* tSigDataPtr = tSignal->getDataPtrSend();
-      NdbApiSignal* tnextSignal = tSignal->next();
-      tSignalCount++;
-      tSigDataPtr[0] = aTC_ConnectPtr;
-      tSigDataPtr[1] = tTransId1;
-      tSigDataPtr[2] = tTransId2;
-      if (remainingKey > IndxKeyInfo::DataLength) {
-	// The signal is full
-	tSignal->setLength(IndxKeyInfo::MaxSignalLength);
-	remainingKey -= IndxKeyInfo::DataLength;
-      }
-      else {
-	// Last signal
-	tSignal->setLength(IndxKeyInfo::HeaderLength + remainingKey);
-	remainingKey = 0;
-      }
-      tSignal = tnextSignal;
-    } while (tSignal != NULL);
-    tAttrInfoIndex = tKeyIndex + TcKeyReq::MaxKeyInfo;
-  } else {
-    tAttrInfoIndex = tKeyIndex + tIndexLen;
-  }//if
-
-//-------------------------------------------------------------
-// Perform the Attrinfo packing in the TCKEYREQ signal started
-// above.
-//-------------------------------------------------------------
-  Uint32* tAIDataPtr = &tOptionalDataPtr[tAttrInfoIndex];
-  Tdata1 = tcKeyReq->attrInfo[0];
-  Tdata2 = tcKeyReq->attrInfo[1];
-  Tdata3 = tcKeyReq->attrInfo[2];
-  Tdata4 = tcKeyReq->attrInfo[3];
-  Tdata5 = tcKeyReq->attrInfo[4];
-
-  theTCREQ->setLength(tcKeyReq->getAIInTcKeyReq(tReqInfo) + 
-                      tAttrInfoIndex + TcKeyReq::StaticLength);
-  tAIDataPtr[0] = Tdata1;
-  tAIDataPtr[1] = Tdata2;
-  tAIDataPtr[2] = Tdata3;
-  tAIDataPtr[3] = Tdata4;
-  tAIDataPtr[4] = Tdata5;
-
-/***************************************************
-*  Send the INDXATTRINFO signals.
-***************************************************/
-  if (tTotalCurrAI_Len > 5) {
-    // Set the last signal's length.
-    NdbApiSignal* tSignal = theFirstATTRINFO;
-    theCurrentATTRINFO->setLength(theAI_LenInCurrAI);
-    do {
-      Uint32* tSigDataPtr = tSignal->getDataPtrSend();
-      NdbApiSignal* tnextSignal = tSignal->next();
-      tSignalCount++;
-      tSigDataPtr[0] = aTC_ConnectPtr;
-      tSigDataPtr[1] = tTransId1;
-      tSigDataPtr[2] = tTransId2;
-      tSignal = tnextSignal;
-    } while (tSignal != NULL);
-  }//if
-  theStatus = WaitResponse;
-  theReceiver.prepareSend();
-  return 0;
-}
-
 /***************************************************************************
 int receiveTCINDXREF( NdbApiSignal* aSignal)
 

--- 1.28/storage/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-02-08 14:08:57 +01:00
+++ 1.29/storage/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-02-08 14:08:57 +01:00
@@ -367,7 +367,7 @@ NdbOperation::getValue_impl(const NdbCol
 	  setErrorCodeAbort(4230);
 	  return NULL;
 	}//if
-	// MASV - How would execution come here?
+        /* Final read, after running interpreted instructions. */
 	theStatus = FinalGetValue;
       } else {
 	setErrorCodeAbort(4230);

--- 1.27/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2007-02-08 14:08:57 +01:00
+++ 1.28/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2007-02-08 14:08:57 +01:00
@@ -99,7 +99,9 @@ Parameters:     aTC_ConnectPtr: the Conn
 Remark:         Puts the the data into TCKEYREQ signal and optional KEYINFO and ATTRINFO signals.
 ***************************************************************************/
 int
-NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
+NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, 
+			  Uint64 aTransId,
+			  AbortOption ao)
 {
   Uint32 tTransId1, tTransId2;
   Uint32 tReqInfo;
@@ -147,8 +149,8 @@ NdbOperation::prepareSend(Uint32 aTC_Con
 //-------------------------------------------------------------
   TcKeyReq * const tcKeyReq = CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend());
 
-  Uint32 tTableId = m_currentTable->m_id;
-  Uint32 tSchemaVersion = m_currentTable->m_version;
+  Uint32 tTableId = m_accessTable->m_id;
+  Uint32 tSchemaVersion = m_accessTable->m_version;
   
   tcKeyReq->apiConnectPtr      = aTC_ConnectPtr;
   tcKeyReq->apiOperationPtr    = ptr2int();
@@ -198,16 +200,16 @@ NdbOperation::prepareSend(Uint32 aTC_Con
 
   OperationType tOperationType = theOperationType;
   Uint32 tTupKeyLen = theTupKeyLen;
-  Uint8 abortOption =
-    m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption;
+  Uint8 abortOption = (ao == DefaultAbortOption) ? m_abortOption : ao;
 
   tcKeyReq->setDirtyFlag(tReqInfo, tDirtyIndicator);
   tcKeyReq->setOperationType(tReqInfo, tOperationType);
   tcKeyReq->setKeyLength(tReqInfo, tTupKeyLen);
   
   // A simple read is always ignore error
-  abortOption = tSimpleIndicator ? (Uint8) AO_IgnoreError : abortOption;
+  abortOption = tSimpleState ? AO_IgnoreError : abortOption;
   tcKeyReq->setAbortOption(tReqInfo, abortOption);
+  m_abortOption = abortOption;
   
   Uint8 tDistrKeyIndicator = theDistrKeyIndicator_;
   Uint8 tScanIndicator = theScanInfo & 1;
@@ -977,21 +979,16 @@ NdbOperation::receiveTCKEYREF( NdbApiSig
     return -1;
   }//if
 
-  AbortOption ao = (AbortOption)
-    (m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption);
+  setErrorCode(aSignal->readData(4));
+  theStatus = Finished;
   theReceiver.m_received_result_length = ~0;
 
-  theStatus = Finished;
-  // blobs want this
-  if (m_abortOption != AO_IgnoreError)
+  // not simple read
+  if(! (theOperationType == ReadRequest && theSimpleIndicator))
   {
-    theNdbCon->theReturnStatus = NdbTransaction::ReturnFailure;
+    theNdbCon->OpCompleteFailure(this);
+    return -1;
   }
-  theError.code = aSignal->readData(4);
-  theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao);
-
-  if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read
-    return theNdbCon->OpCompleteFailure(ao, m_abortOption != AO_IgnoreError);
   
   /**
    * If TCKEYCONF has arrived
@@ -999,7 +996,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSig
    */
   if(theReceiver.m_expected_result_length)
   {
-    return theNdbCon->OpCompleteFailure(AbortOnError);
+    return theNdbCon->OpCompleteFailure(this);
   }
   
   return -1;

--- 1.107/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-02-08 14:08:57 +01:00
+++ 1.108/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-02-08 14:08:57 +01:00
@@ -1029,7 +1029,6 @@ NdbScanOperation::doSendScan(int aProces
   tSignal = theSCAN_TABREQ;
   
   Uint32 tupKeyLen = theTupKeyLen;
-  Uint32 len = theTotalNrOfKeyWordInSignal;
   Uint32 aTC_ConnectPtr = theNdbCon->theTCConPtr;
   Uint64 transId = theNdbCon->theTransactionId;
   
@@ -1182,6 +1181,7 @@ NdbScanOperation::takeOverScanOp(Operati
     
     newOp->theTupKeyLen = len;
     newOp->theOperationType = opType;
+    newOp->m_abortOption = AbortOnError;
     switch (opType) {
     case (ReadRequest):
       newOp->theLockMode = theLockMode;
@@ -1465,25 +1465,31 @@ NdbIndexScanOperation::setBound(const Nd
     const bool nobytes = (len & 0x3) == 0;
     const Uint32 totalLen = 2 + sizeInWords;
     Uint32 tupKeyLen = theTupKeyLen;
+    union {
+      Uint32 tempData[2000];
+      Uint64 __align;
+    };
+    Uint64 *valPtr;
     if(remaining > totalLen && aligned && nobytes){
       Uint32 * dst = theKEYINFOptr + currLen;
       * dst ++ = type;
       * dst ++ = ahValue;
       memcpy(dst, aValue, 4 * sizeInWords);
       theTotalNrOfKeyWordInSignal = currLen + totalLen;
+      valPtr = (Uint64*)aValue;
     } else {
       if(!aligned || !nobytes){
-        Uint32 tempData[2000];
 	tempData[0] = type;
 	tempData[1] = ahValue;
 	tempData[2 + (len >> 2)] = 0;
         memcpy(tempData+2, aValue, len);
-	
 	insertBOUNDS(tempData, 2+sizeInWords);
+	valPtr = (Uint64*)(tempData+2);
       } else {
 	Uint32 buf[2] = { type, ahValue };
 	insertBOUNDS(buf, 2);
 	insertBOUNDS((Uint32*)aValue, sizeInWords);
+	valPtr = (Uint64*)aValue;
       }
     }
     theTupKeyLen = tupKeyLen + totalLen;
@@ -1497,10 +1503,10 @@ NdbIndexScanOperation::setBound(const Nd
      * so it's safe to use [tIndexAttrId] 
      * (instead of looping as in NdbOperation::equal_impl)
      */
-    if(type == BoundEQ && tDistrKey)
+    if(type == BoundEQ && tDistrKey && !m_multi_range)
     {
       theNoOfTupKeyLeft--;
-      return handle_distribution_key((Uint64*)aValue, sizeInWords);
+      return handle_distribution_key(valPtr, sizeInWords);
     }
     return 0;
   } else {
@@ -1644,7 +1650,8 @@ NdbIndexScanOperation::readTuples(LockMo
   const bool order_by = scan_flags & SF_OrderBy;
   const bool order_desc = scan_flags & SF_Descending;
   const bool read_range_no = scan_flags & SF_ReadRangeNo;
-  
+  m_multi_range = scan_flags & SF_MultiRange;
+
   int res = NdbScanOperation::readTuples(lm, scan_flags, parallel, batch);
   if(!res && read_range_no)
   {
@@ -2386,6 +2393,12 @@ NdbIndexScanOperation::reset_bounds(bool
 int
 NdbIndexScanOperation::end_of_bound(Uint32 no)
 {
+  DBUG_ENTER("end_of_bound");
+  DBUG_PRINT("info", ("Range number %u", no));
+  /* Check that SF_MultiRange has been specified if more
+     than one range is specified */
+  if (no > 0 && !m_multi_range)
+    DBUG_RETURN(-1);
   if(no < (1 << 13)) // Only 12-bits no of ranges
   {
     Uint32 bound_head = * m_first_bound_word;
@@ -2394,9 +2407,9 @@ NdbIndexScanOperation::end_of_bound(Uint
     
     m_first_bound_word = theKEYINFOptr + theTotalNrOfKeyWordInSignal;;
     m_this_bound_start = theTupKeyLen;
-    return 0;
+    DBUG_RETURN(0);
   }
-  return -1;
+  DBUG_RETURN(-1);
 }
 
 int

--- 1.28/storage/ndb/tools/select_all.cpp	2007-02-08 14:08:57 +01:00
+++ 1.29/storage/ndb/tools/select_all.cpp	2007-02-08 14:08:57 +01:00
@@ -39,7 +39,7 @@ NDB_STD_OPTS_VARS;
 
 static const char* _dbname = "TEST_DB";
 static const char* _delimiter = "\t";
-static int _unqualified, _header, _parallelism, _useHexFormat, _lock,
+static int _header, _parallelism, _useHexFormat, _lock,
   _order, _descending;
 
 const char *load_default_groups[]= { "mysql_cluster",0 };
@@ -96,6 +96,7 @@ static struct my_option my_long_options[
 };
 static void usage()
 {
+#ifdef NOT_USED
   char desc[] = 
     "tabname\n"\
     "This program reads all records from one table in NDB Cluster\n"\
@@ -103,6 +104,7 @@ static void usage()
     "(It only print error messages if it encounters a permanent error.)\n"\
     "It can also be used to dump the content of a table to file \n"\
     "  ex: select_all --no-header --delimiter=';' T4 > T4.data\n";
+#endif
   ndb_std_print_version();
   print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
   puts("");

--- 1.83/storage/ndb/src/ndbapi/ndberror.c	2007-02-08 14:08:57 +01:00
+++ 1.84/storage/ndb/src/ndbapi/ndberror.c	2007-02-08 14:08:57 +01:00
@@ -229,7 +229,6 @@ ErrorBundle ErrorCodes[] = {
   /**
    * Internal errors
    */
-  { 892,  DMEC, IE, "Inconsistent hash index. The index needs to be dropped and recreated" },
   { 896,  DMEC, IE, "Tuple corrupted - wrong checksum or column data in invalid format" },
   { 901,  DMEC, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" },
   { 202,  DMEC, IE, "202" },
Thread
bk commit into 5.1 tree (knielsen:1.2431)knielsen8 Feb