MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:April 3 2007 10:57am
Subject:bk commit into 5.1 tree (tomas:1.2542) BUG#17095
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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-03 12:57:18+02:00, tomas@stripped +22 -0
  Bug #17095 Cluster RBR in circle does not terminate
  - add any value to ndb
  - use it to update correct server id in binlog thread

  sql/ha_ndbcluster.cc@stripped, 2007-04-03 12:57:14+02:00, tomas@stripped +13 -0
    ndb: use "any value" to set correct server_id

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-04-03 12:57:14+02:00, tomas@stripped +10 -5
    ndb: use "any value" to set correct server_id

  storage/ndb/include/kernel/AttributeHeader.hpp@stripped, 2007-04-03 12:57:14+02:00, tomas@stripped +2 -1
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp@stripped, 2007-04-03 12:57:14+02:00, tomas@stripped +16 -1
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/include/kernel/signaldata/SumaImpl.hpp@stripped, 2007-04-03 12:57:14+02:00, tomas@stripped +4 -1
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/include/ndbapi/NdbDictionary.hpp@stripped, 2007-04-03 12:57:14+02:00, tomas@stripped +1 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/include/ndbapi/NdbEventOperation.hpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +7 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/include/ndbapi/NdbOperation.hpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +3 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +1 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +1 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +10 -2
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +1 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +21 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +2 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +2 -1
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +11 -6
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +6 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/ndbapi/NdbEventOperation.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +6 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +6 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +1 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/ndbapi/NdbOperationDefine.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +27 -0
    add any_value as psudo column, updatable from ndbapi

  storage/ndb/src/ndbapi/ndb_cluster_connection.cpp@stripped, 2007-04-03 12:57:15+02:00, tomas@stripped +4 -0
    add any_value as psudo column, updatable from ndbapi

# 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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new-ndb

--- 1.15/storage/ndb/include/kernel/AttributeHeader.hpp	2006-12-23 20:20:03 +01:00
+++ 1.16/storage/ndb/include/kernel/AttributeHeader.hpp	2007-04-03 12:57:14 +02:00
@@ -45,7 +45,8 @@
   STATIC_CONST( ROWID        = 0xFFF6 );
   STATIC_CONST( ROW_GCI      = 0xFFF5 );
   STATIC_CONST( FRAGMENT_VARSIZED_MEMORY = 0xFFF4 );
-
+  STATIC_CONST( ANY_VALUE    = 0xFFF3 );
+  
   // NOTE: in 5.1 ctors and init take size in bytes
 
   /** Initialize AttributeHeader at location aHeaderPtr */

--- 1.4/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp	2006-12-23 20:20:05 +01:00
+++ 1.5/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp	2007-04-03 12:57:14 +02:00
@@ -53,7 +53,7 @@
 public:
   STATIC_CONST( SignalLength = 8 );
   STATIC_CONST( SignalWithGCILength = 9 );
-  STATIC_CONST( SignalWithHashValueLength = 10 );
+  STATIC_CONST( SignalLengthSuma = 11 );
 
 private:
   Uint32 m_connectionPtr;
@@ -66,6 +66,7 @@
   Uint32 fragId;
   Uint32 m_gci;
   Uint32 m_hashValue;
+  Uint32 m_any_value;
   // Public methods
 public:
   Uint32 getConnectionPtr() const;
@@ -86,6 +87,8 @@
   void setGCI(Uint32);
   Uint32 getHashValue() const;
   void setHashValue(Uint32);
+  Uint32 getAnyValue() const;
+  void setAnyValue(Uint32);
 };
 
 inline
@@ -194,6 +197,18 @@
 void FireTrigOrd::setHashValue(Uint32 flag)
 {
   m_hashValue = flag;
+}
+
+inline
+Uint32 FireTrigOrd::getAnyValue() const
+{
+  return m_any_value;
+}
+
+inline
+void FireTrigOrd::setAnyValue(Uint32 any_value)
+{
+  m_any_value = any_value;
 }
 
 

--- 1.10/storage/ndb/include/kernel/signaldata/SumaImpl.hpp	2006-12-23 20:20:06 +01:00
+++ 1.11/storage/ndb/include/kernel/signaldata/SumaImpl.hpp	2007-04-03 12:57:14 +02:00
@@ -303,7 +303,10 @@
   Uint32 tableId;
   Uint32 requestInfo;
   Uint32 logType;
-  Uint32 changeMask;
+  union {
+    Uint32 changeMask;
+    Uint32 anyValue;
+  };
   Uint32 totalLen;
 
   static void setOperation(Uint32& ri, Uint32 val) { 

--- 1.88/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-03-23 13:53:15 +01:00
+++ 1.89/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-04-03 12:57:14 +02:00
@@ -534,6 +534,7 @@
     static const Column * RECORDS_IN_RANGE;
     static const Column * ROWID;
     static const Column * ROW_GCI;
+    static const Column * ANY_VALUE;
     
     int getSizeInBytes() const;
 #endif

--- 1.21/storage/ndb/include/ndbapi/NdbEventOperation.hpp	2006-12-23 20:20:08 +01:00
+++ 1.22/storage/ndb/include/ndbapi/NdbEventOperation.hpp	2007-04-03 12:57:15 +02:00
@@ -203,6 +203,13 @@
   Uint64 getGCI() const;
 
   /**
+   * Retrieve the AnyValue of the latest retrieved event
+   *
+   * @return AnyValue
+   */
+  Uint32 getAnyValue() const;
+
+  /**
    * Retrieve the complete GCI in the cluster (not necessarily
    * associated with an event)
    *

--- 1.42/storage/ndb/include/ndbapi/NdbOperation.hpp	2007-02-20 09:52:14 +01:00
+++ 1.43/storage/ndb/include/ndbapi/NdbOperation.hpp	2007-04-03 12:57:15 +02:00
@@ -413,6 +413,9 @@
   int  setValue(const char* anAttrName, Uint64 aValue);
   int  setValue(const char* anAttrName, float aValue);
   int  setValue(const char* anAttrName, double aValue);
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+  int  setAnyValue(Uint32 aValue);
+#endif
 
 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
   int  setValue(Uint32 anAttrId, const char* aValue, Uint32 len);

--- 1.64/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-03-29 14:10:47 +02:00
+++ 1.65/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-04-03 12:57:15 +02:00
@@ -753,6 +753,7 @@
   union {
     Uint32 firstAttrinbufrec; //Used until copyAttrinfo
   };
+  Uint32 m_any_value;
   union {
     Uint32 lastAttrinbufrec; //Used until copyAttrinfo
     Uint32 nextPool;

--- 1.17/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp	2007-03-29 13:52:13 +02:00
+++ 1.18/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp	2007-04-03 12:57:15 +02:00
@@ -35,6 +35,7 @@
   }//if
   regOperPtr->firstAttrinbufrec = RNIL;
   regOperPtr->lastAttrinbufrec = RNIL;
+  regOperPtr->m_any_value = 0;
 }//Dbtup::freeAllAttrBuffers()
 
 void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf) 

--- 1.57/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-03-29 13:52:13 +02:00
+++ 1.58/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-04-03 12:57:15 +02:00
@@ -102,6 +102,7 @@
   regOperPtr->storedProcedureId= RNIL;
   regOperPtr->firstAttrinbufrec= RNIL;
   regOperPtr->lastAttrinbufrec= RNIL;
+  regOperPtr->m_any_value= 0;
 }
 
 void Dbtup::handleATTRINFOforTUPKEYREQ(Signal* signal,
@@ -811,6 +812,7 @@
      else if(Roptype == ZDELETE)
      {
        jam();
+       req_struct.log_size= 0;
        if (handleDeleteReq(signal, regOperPtr,
 			   regFragPtr, regTabPtr, 
 			   &req_struct,
@@ -829,7 +831,6 @@
 					 regOperPtr, 
 					 regTabPtr);
        set_change_mask_state(regOperPtr, DELETE_CHANGES);
-       req_struct.log_size= 0;
        sendTUPKEYCONF(signal, &req_struct, regOperPtr);
        return;
      }
@@ -1536,7 +1537,14 @@
 
   if (setup_read(req_struct, regOperPtr, regFragPtr, regTabPtr, disk))
   {
-    return handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
+    Uint32 RlogSize;
+    int ret= handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
+    if (ret == 0 && (RlogSize= req_struct->log_size))
+    {
+      jam();
+      sendLogAttrinfo(signal, RlogSize, regOperPtr);
+    }
+    return ret;
   }
 
 error:

--- 1.41/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-03-29 13:52:13 +02:00
+++ 1.42/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-04-03 12:57:15 +02:00
@@ -680,6 +680,7 @@
   new (regOperPtr.p) Operationrec();
   regOperPtr.p->firstAttrinbufrec = RNIL;
   regOperPtr.p->lastAttrinbufrec = RNIL;
+  regOperPtr.p->m_any_value = 0;
   regOperPtr.p->op_struct.op_type = ZREAD;
   regOperPtr.p->op_struct.in_active_list = false;
   set_trans_state(regOperPtr.p, TRANS_DISCONNECTED);

--- 1.34/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-03-13 11:18:11 +01:00
+++ 1.35/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-04-03 12:57:15 +02:00
@@ -221,6 +221,18 @@
         return -1;
       }
     } else if(attributeId & AttributeHeader::PSEUDO) {
+      if (attributeId == AttributeHeader::ANY_VALUE)
+      {
+        jam();
+        Uint32 RlogSize = req_struct->log_size;
+        operPtr.p->m_any_value = inBuffer[inBufIndex];
+        * (clogMemBuffer + RlogSize) = inBuffer[inBufIndex - 1];
+        * (clogMemBuffer + RlogSize + 1) = inBuffer[inBufIndex];
+        inBufIndex++;
+        req_struct->out_buf_index = tmpAttrBufIndex;
+        req_struct->log_size = RlogSize + 2;
+        continue;
+      }
       jam();
       Uint32 sz= read_pseudo(attributeId,
                              req_struct,
@@ -778,6 +790,15 @@
       req_struct->m_tuple_ptr->m_header_bits |= Tuple_header::DISK_PART;
       memcpy(req_struct->m_tuple_ptr->get_disk_ref_ptr(regTabPtr),
 	     inBuffer+inBufIndex+1, sz << 2);
+      inBufIndex += 1 + sz;
+      req_struct->in_buf_index = inBufIndex;
+    }
+    else if(attributeId == AttributeHeader::ANY_VALUE)
+    {
+      jam();
+      Uint32 sz= ahIn.getDataSize();
+      ndbrequire(sz == 1);
+      regOperPtr->m_any_value = * (inBuffer + inBufIndex + 1);
       inBufIndex += 1 + sz;
       req_struct->in_buf_index = inBufIndex;
     }

--- 1.5/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp	2007-03-02 19:45:02 +01:00
+++ 1.6/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp	2007-04-03 12:57:15 +02:00
@@ -203,6 +203,7 @@
   storedPtr.p->storedLinkLast = regOperPtr->lastAttrinbufrec;
   regOperPtr->firstAttrinbufrec = RNIL;
   regOperPtr->lastAttrinbufrec = RNIL;
+  regOperPtr->m_any_value = 0;
   set_trans_state(regOperPtr, TRANS_IDLE);
   signal->theData[0] = regOperPtr->userpointer;
   signal->theData[1] = storedPtr.i;
@@ -220,6 +221,7 @@
   storedPtr.p->storedLinkFirst = regOperPtr->firstAttrinbufrec;
   regOperPtr->firstAttrinbufrec = RNIL;
   regOperPtr->lastAttrinbufrec = RNIL;
+  regOperPtr->m_any_value = 0;
   set_trans_state(regOperPtr, TRANS_ERROR_WAIT_STORED_PROCREQ);
   signal->theData[0] = regOperPtr->userpointer;
   signal->theData[1] = ZSTORED_SEIZE_ATTRINBUFREC_ERROR;

--- 1.28/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2007-03-02 19:45:02 +01:00
+++ 1.29/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2007-04-03 12:57:15 +02:00
@@ -1048,10 +1048,11 @@
     // send to backup directly for now
     fireTrigOrd->setGCI(req_struct->gci);
     fireTrigOrd->setHashValue(req_struct->hash_value);
+    fireTrigOrd->m_any_value = regOperPtr->m_any_value;
     EXECUTE_DIRECT(trigPtr->m_receiverBlock,
                    GSN_FIRE_TRIG_ORD,
                    signal,
-		   FireTrigOrd::SignalWithHashValueLength);
+		   FireTrigOrd::SignalLengthSuma);
     break;
   case (TriggerType::SUBSCRIPTION):
     jam();

--- 1.60/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-03-27 14:32:26 +02:00
+++ 1.61/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-04-03 12:57:15 +02:00
@@ -3469,6 +3469,7 @@
   const Uint32 hashValue = trg->getHashValue();
   const Uint32 gci       = trg->getGCI();
   const Uint32 event     = trg->getTriggerEvent();
+  const Uint32 any_value = trg->getAnyValue();
   TablePtr tabPtr;
   tabPtr.i               = trigId & 0xFFFF;
 
@@ -3509,7 +3510,7 @@
     data->requestInfo    = 0;
     SubTableData::setOperation(data->requestInfo, event);
     data->logType        = 0;
-    data->changeMask     = 0;
+    data->anyValue       = any_value;
     data->totalLen       = ptrLen;
     
     {
@@ -3527,13 +3528,15 @@
   }
   else 
   {
+    const uint buffer_header_sz = 4;
     Uint32* dst;
-    Uint32 sz = f_trigBufferSize + b_trigBufferSize + 3;
+    Uint32 sz = f_trigBufferSize + b_trigBufferSize + buffer_header_sz;
     if((dst = get_buffer_ptr(signal, bucket, gci, sz)))
     {
       * dst++ = tableId;
       * dst++ = tabPtr.p->m_schemaVersion;
       * dst++ = (event << 16) | f_trigBufferSize;
+      * dst++ = any_value;
       memcpy(dst, f_buffer, f_trigBufferSize << 2);
       dst += f_trigBufferSize;
       memcpy(dst, b_buffer, b_trigBufferSize << 2);
@@ -5029,18 +5032,20 @@
     } 
     else
     {
+      const uint buffer_header_sz = 4;
       g_cnt++;
       Uint32 table = * src++ ;
       Uint32 schemaVersion = * src++;
       Uint32 event = * src >> 16;
       Uint32 sz_1 = (* src ++) & 0xFFFF;
-      
-      ndbassert(sz - 3 >= sz_1);
+      Uint32 any_value = * src++;
+
+      ndbassert(sz - buffer_header_sz >= sz_1);
       
       LinearSectionPtr ptr[3];
       const Uint32 nptr= reformat(signal, ptr, 
 				  src, sz_1, 
-				  src + sz_1, sz - 3 - sz_1);
+				  src + sz_1, sz - buffer_header_sz - sz_1);
       Uint32 ptrLen= 0;
       for(Uint32 i =0; i < nptr; i++)
         ptrLen+= ptr[i].sz;
@@ -5058,7 +5063,7 @@
 	data->requestInfo    = 0;
 	SubTableData::setOperation(data->requestInfo, event);
 	data->logType        = 0;
-	data->changeMask     = 0;
+	data->anyValue       = any_value;
 	data->totalLen       = ptrLen;
 	
 	{

--- 1.164/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-03-23 17:17:41 +01:00
+++ 1.165/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-03 12:57:15 +02:00
@@ -378,6 +378,11 @@
     col->m_impl.m_attrSize = 8;
     col->m_impl.m_arraySize = 1;
     col->m_impl.m_nullable = true;
+  } else if(!strcmp(name, "NDB$ANY_VALUE")){
+    col->setType(NdbDictionary::Column::Unsigned);
+    col->m_impl.m_attrId = AttributeHeader::ANY_VALUE;
+    col->m_impl.m_attrSize = 4;
+    col->m_impl.m_arraySize = 1;
   } else {
     abort();
   }
@@ -5100,3 +5105,4 @@
 const NdbDictionary::Column * NdbDictionary::Column::RECORDS_IN_RANGE = 0;
 const NdbDictionary::Column * NdbDictionary::Column::ROWID = 0;
 const NdbDictionary::Column * NdbDictionary::Column::ROW_GCI = 0;
+const NdbDictionary::Column * NdbDictionary::Column::ANY_VALUE = 0;

--- 1.14/storage/ndb/src/ndbapi/NdbEventOperation.cpp	2006-12-23 20:20:22 +01:00
+++ 1.15/storage/ndb/src/ndbapi/NdbEventOperation.cpp	2007-04-03 12:57:15 +02:00
@@ -122,6 +122,12 @@
   return m_impl.getGCI();
 }
 
+Uint32
+NdbEventOperation::getAnyValue() const
+{
+  return m_impl.getAnyValue();
+}
+
 Uint64
 NdbEventOperation::getLatestGCI() const
 {

--- 1.84/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2007-03-21 08:23:11 +01:00
+++ 1.85/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2007-04-03 12:57:15 +02:00
@@ -683,6 +683,12 @@
   return m_data_item->sdata->gci;
 }
 
+Uint32
+NdbEventOperationImpl::getAnyValue() const
+{
+  return m_data_item->sdata->anyValue;
+}
+
 Uint64
 NdbEventOperationImpl::getLatestGCI()
 {

--- 1.34/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2007-01-25 05:17:41 +01:00
+++ 1.35/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2007-04-03 12:57:15 +02:00
@@ -366,6 +366,7 @@
   const bool tableFragmentationChanged() const;
   const bool tableRangeListChanged() const;
   Uint64 getGCI();
+  Uint32 getAnyValue() const;
   Uint64 getLatestGCI();
   bool execSUB_TABLE_DATA(NdbApiSignal * signal, 
                           LinearSectionPtr ptr[3]);

--- 1.29/storage/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-02-20 09:52:14 +01:00
+++ 1.30/storage/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-04-03 12:57:15 +02:00
@@ -571,6 +571,33 @@
   DBUG_RETURN(0);
 }//NdbOperation::setValue()
 
+
+int
+NdbOperation::setAnyValue(Uint32 any_value)
+{
+  const NdbColumnImpl* impl =
+    &NdbColumnImpl::getImpl(* NdbDictionary::Column::ANY_VALUE);
+  OperationType tOpType = theOperationType;
+  OperationStatus tStatus = theStatus;
+
+  switch(tOpType){
+  case DeleteRequest:{
+    Uint32 ah;
+    AttributeHeader::init(&ah, AttributeHeader::ANY_VALUE, 4);
+    if (insertATTRINFO(ah) != -1 && insertATTRINFO(any_value) != -1 ) 
+    {
+      return 0;
+    }
+  }
+  default:
+    return setValue(impl, (const char *)&any_value);
+  }
+
+  setErrorCodeAbort(4000);
+  return -1;
+}
+
+
 NdbBlob*
 NdbOperation::getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* tAttrInfo)
 {

--- 1.431/sql/ha_ndbcluster.cc	2007-04-03 09:53:13 +02:00
+++ 1.432/sql/ha_ndbcluster.cc	2007-04-03 12:57:14 +02:00
@@ -2712,6 +2712,9 @@
     op->setValue(no_fields, part_func_value);
   }
 
+  if (thd->slave_thread)
+    op->setAnyValue(thd->server_id);
+
   m_rows_changed++;
 
   /*
@@ -2992,6 +2995,10 @@
       no_fields++;
     op->setValue(no_fields, part_func_value);
   }
+
+  if (thd->slave_thread)
+    op->setAnyValue(thd->server_id);
+
   // Execute update operation
   if (!cursor && execute_no_commit(this,trans,FALSE) != 0) {
     no_uncommitted_rows_execute_failure();
@@ -3047,6 +3054,9 @@
 
     no_uncommitted_rows_update(-1);
 
+    if (thd->slave_thread)
+      ((NdbOperation *)trans->getLastDefinedOperation())->setAnyValue(thd->server_id);
+
     if (!m_primary_key_update)
       // If deleting from cursor, NoCommit will be handled in next_result
       DBUG_RETURN(0);
@@ -3076,6 +3086,9 @@
       if ((error= set_primary_key_from_record(op, record)))
         DBUG_RETURN(error);
     }
+
+    if (thd->slave_thread)
+      op->setAnyValue(thd->server_id);
   }
 
   // Execute delete operation

--- 1.50/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-03-07 15:50:45 +01:00
+++ 1.51/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-04-03 12:57:15 +02:00
@@ -328,6 +328,8 @@
       NdbColumnImpl::create_pseudo("NDB$ROWID");
     NdbDictionary::Column::ROW_GCI= 
       NdbColumnImpl::create_pseudo("NDB$ROW_GCI");
+    NdbDictionary::Column::ANY_VALUE= 
+      NdbColumnImpl::create_pseudo("NDB$ANY_VALUE");
   }
   NdbMutex_Unlock(g_ndb_connection_mutex);
 
@@ -382,6 +384,7 @@
     delete NdbDictionary::Column::RECORDS_IN_RANGE;
     delete NdbDictionary::Column::ROWID;
     delete NdbDictionary::Column::ROW_GCI;
+    delete NdbDictionary::Column::ANY_VALUE;
     NdbDictionary::Column::FRAGMENT= 0;
     NdbDictionary::Column::FRAGMENT_FIXED_MEMORY= 0;
     NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY= 0;
@@ -393,6 +396,7 @@
     NdbDictionary::Column::RECORDS_IN_RANGE= 0;
     NdbDictionary::Column::ROWID= 0;
     NdbDictionary::Column::ROW_GCI= 0;
+    NdbDictionary::Column::ANY_VALUE= 0;
   }
   NdbMutex_Unlock(g_ndb_connection_mutex);
 

--- 1.107/sql/ha_ndbcluster_binlog.cc	2007-04-03 07:21:38 +02:00
+++ 1.108/sql/ha_ndbcluster_binlog.cc	2007-04-03 12:57:14 +02:00
@@ -3189,8 +3189,12 @@
   NDB_SHARE *share= (NDB_SHARE*) pOp->getCustomData();
   if (share == ndb_apply_status_share)
     return 0;
-  TABLE *table= share->table;
 
+  uint originating_server_id= pOp->getAnyValue();
+  if (originating_server_id == 0)
+    originating_server_id= ::server_id;
+
+  TABLE *table= share->table;
   DBUG_ASSERT(trans.good());
   DBUG_ASSERT(table != 0);
 
@@ -3235,7 +3239,7 @@
         DBUG_ASSERT(ret == 0);
       }
       ndb_unpack_record(table, share->ndb_value[0], &b, table->record[0]);
-      IF_DBUG(int ret=) trans.write_row(::server_id,
+      IF_DBUG(int ret=) trans.write_row(originating_server_id,
                                         injector::transaction::table(table,
                                                                      TRUE),
                                         &b, n_fields, table->record[0]);
@@ -3275,7 +3279,7 @@
       }
       ndb_unpack_record(table, share->ndb_value[n], &b, table->record[n]);
       DBUG_EXECUTE("info", print_records(table, table->record[n]););
-      IF_DBUG(int ret =) trans.delete_row(::server_id,
+      IF_DBUG(int ret =) trans.delete_row(originating_server_id,
                                           injector::transaction::table(table,
                                                                        TRUE),
                                           &b, n_fields, table->record[n]);
@@ -3305,7 +3309,8 @@
           since table has a primary key, we can do a write
           using only after values
         */
-        trans.write_row(::server_id, injector::transaction::table(table, TRUE),
+        trans.write_row(originating_server_id,
+                        injector::transaction::table(table, TRUE),
                         &b, n_fields, table->record[0]);// after values
       }
       else
@@ -3325,7 +3330,7 @@
         }
         ndb_unpack_record(table, share->ndb_value[1], &b, table->record[1]);
         DBUG_EXECUTE("info", print_records(table, table->record[1]););
-        IF_DBUG(int ret =) trans.update_row(::server_id,
+        IF_DBUG(int ret =) trans.update_row(originating_server_id,
                                             injector::transaction::table(table,
                                                                          TRUE),
                                             &b, n_fields,
Thread
bk commit into 5.1 tree (tomas:1.2542) BUG#17095tomas3 Apr