List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:May 25 2011 2:37pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (frazer.clement:4225 to 4226)
View as plain text  
 4226 Frazer Clement	2011-05-25 [merge]
      Merge 7.0->7.1

    modified:
      storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp
      storage/ndb/include/kernel/signaldata/SumaImpl.hpp
      storage/ndb/include/kernel/signaldata/TupCommit.hpp
      storage/ndb/include/ndbapi/NdbEventOperation.hpp
      storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/ndbapi/NdbEventOperation.cpp
      storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
      storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
      storage/ndb/test/include/HugoOperations.hpp
      storage/ndb/test/ndbapi/test_event.cpp
      storage/ndb/test/src/HugoOperations.cpp
 4225 Frazer Clement	2011-05-25 [merge]
      Merge 7.0->7.1

    modified:
      storage/ndb/include/kernel/kernel_types.h
      storage/ndb/include/ndb_version.h.in
      storage/ndb/include/ndbapi/NdbOperation.hpp
      storage/ndb/include/ndbapi/NdbTransaction.hpp
      storage/ndb/src/common/debugger/signaldata/TcKeyReq.cpp
      storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
      storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
      storage/ndb/src/ndbapi/NdbOperationExec.cpp
      storage/ndb/src/ndbapi/NdbTransaction.cpp
      storage/ndb/src/ndbapi/ndberror.c
      storage/ndb/test/include/HugoOperations.hpp
      storage/ndb/test/include/HugoTransactions.hpp
      storage/ndb/test/ndbapi/testBasic.cpp
      storage/ndb/test/ndbapi/testIndex.cpp
      storage/ndb/test/run-test/daily-devel-tests.txt
      storage/ndb/test/src/HugoOperations.cpp
      storage/ndb/test/src/HugoTransactions.cpp
      storage/ndb/test/tools/hugoPkUpdate.cpp
=== modified file 'storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp'
--- a/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp	2011-04-28 07:47:53 +0000
+++ b/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp	2011-05-25 14:31:47 +0000
@@ -57,7 +57,7 @@ class FireTrigOrd {
 public:
   STATIC_CONST( SignalLength = 11 );
   STATIC_CONST( SignalWithGCILength = 9 );
-  STATIC_CONST( SignalLengthSuma = 12 );
+  STATIC_CONST( SignalLengthSuma = 14 );
 
 private:
   Uint32 m_connectionPtr;
@@ -72,15 +72,11 @@ private:
     Uint32 m_gci_hi;
     Uint32 m_triggerType;
   };
-  union {
-    Uint32 m_hashValue;
-    Uint32 m_transId1;
-  };
-  union {
-    Uint32 m_any_value;
-    Uint32 m_transId2;
-  };
+  Uint32 m_transId1;
+  Uint32 m_transId2;
   Uint32 m_gci_lo;
+  Uint32 m_hashValue;
+  Uint32 m_any_value;
   // Public methods
 public:
   Uint32 getConnectionPtr() const;

=== modified file 'storage/ndb/include/kernel/signaldata/SumaImpl.hpp'
--- a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp	2011-05-25 14:31:47 +0000
@@ -306,6 +306,7 @@ struct SubSyncConf {
 struct SubTableData {
   friend bool printSUB_TABLE_DATA(FILE *, const Uint32 *, Uint32, Uint16);
   STATIC_CONST( SignalLength = 8 );
+  STATIC_CONST( SignalLengthWithTransId = 10 );
   SECTION( DICT_TAB_INFO = 0 );
   SECTION( ATTR_INFO = 0 );
   SECTION( AFTER_VALUES = 1 );
@@ -329,6 +330,8 @@ struct SubTableData {
   };
   Uint32 totalLen;
   Uint32 gci_lo;
+  Uint32 transId1;
+  Uint32 transId2;
 
   static void setOperation(Uint32& ri, Uint32 val) { 
     ri = (ri & 0xFFFFFF00) | val;

=== modified file 'storage/ndb/include/kernel/signaldata/TupCommit.hpp'
--- a/storage/ndb/include/kernel/signaldata/TupCommit.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/TupCommit.hpp	2011-05-25 14:31:47 +0000
@@ -38,7 +38,7 @@ class TupCommitReq {
   friend bool printTUPCOMMITREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
 
 public:
-  STATIC_CONST( SignalLength = 5 );
+  STATIC_CONST( SignalLength = 7 );
 
 private:
 
@@ -50,6 +50,8 @@ private:
   Uint32 hashValue;
   Uint32 diskpage;
   Uint32 gci_lo;
+  Uint32 transId1;
+  Uint32 transId2;
 };
 
 #endif

=== modified file 'storage/ndb/include/ndbapi/NdbEventOperation.hpp'
--- a/storage/ndb/include/ndbapi/NdbEventOperation.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/ndbapi/NdbEventOperation.hpp	2011-05-25 14:31:47 +0000
@@ -221,6 +221,17 @@ public:
   Uint64 getLatestGCI() const;
 
   /**
+   * Retrieve the TransId of the latest retrieved event
+   *
+   * Only valid for data events.  If the kernel does not
+   * support transaction ids with events, the max Uint64
+   * value is returned.
+   *
+   * @return TransId
+   */
+  Uint64 getTransId() const;
+
+  /**
    * Get the latest error
    *
    * @return   Error object.

=== modified file 'storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp	2011-05-25 14:31:47 +0000
@@ -182,6 +182,11 @@ printSUB_TABLE_DATA(FILE * output, const
   fprintf(output, " tableId: %x\n", sig->tableId);
   fprintf(output, " operation: %x\n", 
 	  SubTableData::getOperation(sig->requestInfo));
+  if (len == SubTableData::SignalLengthWithTransId)
+  {
+    fprintf(output, " TransId : %x %x\n",
+            sig->transId1, sig->transId2);
+  }
   return false;
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2011-05-25 13:19:02 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2011-05-25 14:31:47 +0000
@@ -3157,7 +3157,8 @@ private:
 
 public:
   bool is_same_trans(Uint32 opId, Uint32 trid1, Uint32 trid2);
-  void get_op_info(Uint32 opId, Uint32 *hash, Uint32* gci_hi, Uint32* gci_lo);
+  void get_op_info(Uint32 opId, Uint32 *hash, Uint32* gci_hi, Uint32* gci_lo,
+                   Uint32* transId1, Uint32* transId2);
   void accminupdate(Signal*, Uint32 opPtrI, const Local_key*);
   void accremoverow(Signal*, Uint32 opPtrI, const Local_key*);
 
@@ -3330,7 +3331,8 @@ Dblqh::is_same_trans(Uint32 opId, Uint32
 
 inline
 void
-Dblqh::get_op_info(Uint32 opId, Uint32 *hash, Uint32* gci_hi, Uint32* gci_lo)
+Dblqh::get_op_info(Uint32 opId, Uint32 *hash, Uint32* gci_hi, Uint32* gci_lo,
+                   Uint32* transId1, Uint32* transId2)
 {
   TcConnectionrecPtr regTcPtr;  
   regTcPtr.i= opId;
@@ -3338,6 +3340,8 @@ Dblqh::get_op_info(Uint32 opId, Uint32 *
   *hash = regTcPtr.p->hashValue;
   *gci_hi = regTcPtr.p->gci_hi;
   *gci_lo = regTcPtr.p->gci_lo;
+  *transId1 = regTcPtr.p->transid[0];
+  *transId2 = regTcPtr.p->transid[1];
 }
 
 #include "../dbacc/Dbacc.hpp"

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-05-25 14:11:22 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-05-25 14:35:46 +0000
@@ -8070,6 +8070,8 @@ void Dblqh::commitContinueAfterBlockedLa
       tupCommitReq->hashValue = regTcPtr.p->hashValue;
       tupCommitReq->diskpage = RNIL;
       tupCommitReq->gci_lo = regTcPtr.p->gci_lo;
+      tupCommitReq->transId1 = regTcPtr.p->transid[0];
+      tupCommitReq->transId2 = regTcPtr.p->transid[1];
       EXECUTE_DIRECT(tup, GSN_TUP_COMMITREQ, signal, 
 		     TupCommitReq::SignalLength);
 

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2011-05-25 13:19:02 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2011-05-25 14:31:47 +0000
@@ -485,12 +485,14 @@ Dbtup::disk_page_commit_callback(Signal*
 {
   Uint32 hash_value;
   Uint32 gci_hi, gci_lo;
+  Uint32 transId1, transId2;
   OperationrecPtr regOperPtr;
 
   jamEntry();
   
   c_operation_pool.getPtr(regOperPtr, opPtrI);
-  c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci_hi, &gci_lo);
+  c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci_hi, &gci_lo,
+                     &transId1, &transId2);
 
   TupCommitReq * const tupCommitReq= (TupCommitReq *)signal->getDataPtr();
   
@@ -499,6 +501,8 @@ Dbtup::disk_page_commit_callback(Signal*
   tupCommitReq->gci_hi= gci_hi;
   tupCommitReq->gci_lo= gci_lo;
   tupCommitReq->diskpage = page_id;
+  tupCommitReq->transId1 = transId1;
+  tupCommitReq->transId2 = transId2;
 
   regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
   regOperPtr.p->m_commit_disk_callback_page= page_id;
@@ -526,12 +530,14 @@ Dbtup::disk_page_log_buffer_callback(Sig
 {
   Uint32 hash_value;
   Uint32 gci_hi, gci_lo;
+  Uint32 transId1, transId2;
   OperationrecPtr regOperPtr;
 
   jamEntry();
   
   c_operation_pool.getPtr(regOperPtr, opPtrI);
-  c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci_hi, &gci_lo);
+  c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci_hi, &gci_lo,
+                     &transId1, &transId2);
   Uint32 page= regOperPtr.p->m_commit_disk_callback_page;
 
   TupCommitReq * const tupCommitReq= (TupCommitReq *)signal->getDataPtr();
@@ -541,6 +547,8 @@ Dbtup::disk_page_log_buffer_callback(Sig
   tupCommitReq->gci_hi= gci_hi;
   tupCommitReq->gci_lo= gci_lo;
   tupCommitReq->diskpage = page;
+  tupCommitReq->transId1 = transId1;
+  tupCommitReq->transId2 = transId2;
 
   ndbassert(regOperPtr.p->op_struct.m_load_diskpage_on_commit == 0);
   regOperPtr.p->op_struct.m_wait_log_buffer= 0;
@@ -667,6 +675,8 @@ void Dbtup::execTUP_COMMITREQ(Signal* si
   Uint32 hash_value= tupCommitReq->hashValue;
   Uint32 gci_hi = tupCommitReq->gci_hi;
   Uint32 gci_lo = tupCommitReq->gci_lo;
+  Uint32 transId1 = tupCommitReq->transId1;
+  Uint32 transId2 = tupCommitReq->transId2;
 
   jamEntry();
 
@@ -687,6 +697,9 @@ void Dbtup::execTUP_COMMITREQ(Signal* si
   req_struct.hash_value= hash_value;
   req_struct.gci_hi = gci_hi;
   req_struct.gci_lo = gci_lo;
+  /* Put transid in req_struct, so detached triggers can access it */
+  req_struct.trans_id1 = transId1;
+  req_struct.trans_id2 = transId2;
   regOperPtr.p->m_commit_disk_callback_page = tupCommitReq->diskpage;
 
 #ifdef VM_TRACE

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2011-05-25 14:11:22 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2011-05-25 14:35:46 +0000
@@ -1510,6 +1510,8 @@ out:
     break;
   case (TriggerType::SUBSCRIPTION_BEFORE): // Only Suma
     jam();
+    fireTrigOrd->m_transId1 = req_struct->trans_id1;
+    fireTrigOrd->m_transId2 = req_struct->trans_id2;
     fireTrigOrd->setGCI(req_struct->gci_hi);
     fireTrigOrd->setHashValue(req_struct->hash_value);
     fireTrigOrd->m_any_value = regOperPtr->m_any_value;

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2011-05-25 14:31:47 +0000
@@ -4292,6 +4292,8 @@ Suma::execFIRE_TRIG_ORD(Signal* signal)
   const Uint64 gci = gci_lo | (Uint64(gci_hi) << 32);
   const Uint32 event     = trg->getTriggerEvent();
   const Uint32 any_value = trg->getAnyValue();
+  const Uint32 transId1  = trg->m_transId1;
+  const Uint32 transId2  = trg->m_transId2;
 
   Ptr<Subscription> subPtr;
   c_subscriptionPool.getPtr(subPtr, trigId & 0xFFFF);
@@ -4364,6 +4366,8 @@ Suma::execFIRE_TRIG_ORD(Signal* signal)
     data->flags          = 0;
     data->anyValue       = any_value;
     data->totalLen       = ptrLen;
+    data->transId1       = transId1;
+    data->transId2       = transId2;
     
     {
       LocalDLList<Subscriber> list(c_subscriberPool, subPtr.p->m_subscribers);
@@ -4372,13 +4376,13 @@ Suma::execFIRE_TRIG_ORD(Signal* signal)
       {
 	data->senderData = subbPtr.p->m_senderData;
 	sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal,
-		   SubTableData::SignalLength, JBB, ptr, nptr);
+		   SubTableData::SignalLengthWithTransId, JBB, ptr, nptr);
       }
     }
   }
   else 
   {
-    const uint buffer_header_sz = 4;
+    const uint buffer_header_sz = 6;
     Uint32* dst;
     Uint32 sz = f_trigBufferSize + b_trigBufferSize + buffer_header_sz;
     if((dst = get_buffer_ptr(signal, bucket, gci, sz)))
@@ -4387,6 +4391,8 @@ Suma::execFIRE_TRIG_ORD(Signal* signal)
       * dst++ = schemaVersion;
       * dst++ = (event << 16) | f_trigBufferSize;
       * dst++ = any_value;
+      * dst++ = transId1;
+      * dst++ = transId2;
       memcpy(dst, f_buffer, f_trigBufferSize << 2);
       dst += f_trigBufferSize;
       memcpy(dst, b_buffer, b_trigBufferSize << 2);
@@ -6362,13 +6368,15 @@ Suma::resend_bucket(Signal* signal, Uint
     } 
     else
     {
-      const uint buffer_header_sz = 4;
+      const uint buffer_header_sz = 6;
       g_cnt++;
       Uint32 subPtrI = * src++ ;
       Uint32 schemaVersion = * src++;
       Uint32 event = * src >> 16;
       Uint32 sz_1 = (* src ++) & 0xFFFF;
       Uint32 any_value = * src++;
+      Uint32 transId1 = * src++;
+      Uint32 transId2 = * src++;
 
       ndbassert(sz - buffer_header_sz >= sz_1);
       
@@ -6400,6 +6408,8 @@ Suma::resend_bucket(Signal* signal, Uint
 	data->flags          = 0;
 	data->anyValue       = any_value;
 	data->totalLen       = ptrLen;
+        data->transId1       = transId1;
+        data->transId2       = transId2;
 	
 	{
           LocalDLList<Subscriber> list(c_subscriberPool,
@@ -6409,7 +6419,7 @@ Suma::resend_bucket(Signal* signal, Uint
           {
             data->senderData = subbPtr.p->m_senderData;
             sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal,
-                       SubTableData::SignalLength, JBB, ptr, nptr);
+                       SubTableData::SignalLengthWithTransId, JBB, ptr, nptr);
           }
         }
       }

=== modified file 'storage/ndb/src/ndbapi/NdbEventOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbEventOperation.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/ndbapi/NdbEventOperation.cpp	2011-05-25 14:31:47 +0000
@@ -137,6 +137,12 @@ NdbEventOperation::getLatestGCI() const
   return m_impl.getLatestGCI();
 }
 
+Uint64
+NdbEventOperation::getTransId() const
+{
+  return m_impl.getTransId();
+}
+
 NdbDictionary::Event::TableEvent
 NdbEventOperation::getEventType() const
 {

=== modified file 'storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2011-02-23 13:20:20 +0000
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2011-05-25 14:35:46 +0000
@@ -791,6 +791,15 @@ NdbEventOperationImpl::getLatestGCI()
   return m_ndb->theEventBuffer->getLatestGCI();
 }
 
+Uint64
+NdbEventOperationImpl::getTransId() const
+{
+  /* Return 64 bit composite */
+  Uint32 transId1 = m_data_item->sdata->transId1;
+  Uint32 transId2 = m_data_item->sdata->transId2;
+  return Uint64(transId1) << 32 | transId2;
+}
+
 bool
 NdbEventOperationImpl::execSUB_TABLE_DATA(const NdbApiSignal * signal,
                                           const LinearSectionPtr ptr[3])
@@ -2763,6 +2772,12 @@ NdbEventBuffer::copy_data(const SubTable
   {
     data->sdata->gci_lo = 0;
   }
+  if (len < SubTableData::SignalLengthWithTransId)
+  {
+    /* No TransId, set to uninit value */
+    data->sdata->transId1 = ~Uint32(0);
+    data->sdata->transId2 = ~Uint32(0);
+  }
 
   int i;
   for (i = 0; i <= 2; i++)
@@ -2838,6 +2853,11 @@ NdbEventBuffer::merge_data(const SubTabl
 {
   DBUG_ENTER_EVENT("NdbEventBuffer::merge_data");
 
+  /* TODO : Consider how/if to merge multiple events/key with different
+   * transid
+   * Same consideration probably applies to AnyValue!
+   */
+
   Uint32 nkey = data->m_event_op->m_eventImpl->m_tableImpl->m_noOfKeys;
 
   int t1 = SubTableData::getOperation(data->sdata->requestInfo);

=== modified file 'storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2011-05-25 14:31:47 +0000
@@ -382,6 +382,7 @@ public:
   Uint64 getGCI();
   Uint32 getAnyValue() const;
   Uint64 getLatestGCI();
+  Uint64 getTransId() const;
   bool execSUB_TABLE_DATA(const NdbApiSignal * signal,
                           const LinearSectionPtr ptr[3]);
 

=== modified file 'storage/ndb/test/include/HugoOperations.hpp'
--- a/storage/ndb/test/include/HugoOperations.hpp	2011-05-25 13:19:02 +0000
+++ b/storage/ndb/test/include/HugoOperations.hpp	2011-05-25 14:31:47 +0000
@@ -152,6 +152,10 @@ public:
   const NdbError& getNdbError() const;
   void setQuiet() { m_quiet = true; }
 
+  typedef Uint32 (*AnyValueCallback)(Ndb*, NdbTransaction*, int rowid, int updVal);
+
+  void setAnyValueCallback(AnyValueCallback);
+
 protected:
   void allocRows(int rows);
   void deallocRows();
@@ -170,10 +174,13 @@ protected:
   int m_async_return;
   friend void HugoOperations_async_callback(int, NdbTransaction*, void*);
   void callback(int res, NdbTransaction*);
+  Uint32 getAnyValueForRowUpd(int row, int update);
+
 
   void setNdbError(const NdbError& error);
   NdbError m_error;
   bool m_quiet;
+  AnyValueCallback avCallback;
 };
 
 #endif

=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp	2011-04-07 07:22:49 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp	2011-05-25 14:31:47 +0000
@@ -164,6 +164,18 @@ static int runCreateEvent(NDBT_Context*
   return NDBT_OK;
 }
 
+Uint32 setAnyValue(Ndb* ndb, NdbTransaction* trans, int rowid, int updVal)
+{
+  /* XOR 2 32bit words of transid together */
+  Uint64 transId = trans->getTransactionId();
+  return transId ^ (transId >> 32);
+}
+
+bool checkAnyValueTransId(Uint64 transId, Uint32 anyValue)
+{
+  return transId && (anyValue == Uint32(transId ^ (transId >> 32)));
+}
+
 struct receivedEvent {
   Uint32 pk;
   Uint32 count;
@@ -295,6 +307,24 @@ eventOperation(Ndb* pNdb, const NdbDicti
 	  abort();
 	}
 
+        /* Check event transaction id */
+        Uint32 anyValue = pOp->getAnyValue();
+        Uint64 transId = pOp->getTransId();
+        if (anyValue)
+        {
+          if (!checkAnyValueTransId(transId, anyValue))
+          {
+            g_err << "ERROR : TransId and AnyValue mismatch.  "
+                  << "Transid : " << transId
+                  << ", AnyValue : " << anyValue
+                  << ", Expected AnyValue : "
+                  << (Uint32) ((transId >> 32) ^ transId)
+                  << endl;
+            abort();
+            return NDBT_FAILED;
+          }
+        }
+
 	if ((int)pk < records) {
 	  recEvent[pk].pk = pk;
 	  recEvent[pk].count++;
@@ -498,6 +528,8 @@ int runEventLoad(NDBT_Context* ctx, NDBT
   int records = ctx->getNumRecords();
   HugoTransactions hugoTrans(*ctx->getTab());
 
+  hugoTrans.setAnyValueCallback(setAnyValue);
+
   sleep(1);
 #if 0
   sleep(5);
@@ -520,6 +552,7 @@ int runEventMixedLoad(NDBT_Context* ctx,
   int loops = ctx->getNumLoops();
   int records = ctx->getNumRecords();
   HugoTransactions hugoTrans(*ctx->getTab());
+  hugoTrans.setAnyValueCallback(setAnyValue);
   
   if(ctx->getPropertyWait("LastGCI_hi", ~(Uint32)0))
   {
@@ -721,6 +754,24 @@ int runEventApplier(NDBT_Context* ctx, N
 	    abort();
 	  }
 
+          /* Check event transaction id */
+          Uint32 anyValue = pOp->getAnyValue();
+          Uint64 transId = pOp->getTransId();
+          if (anyValue)
+          {
+            if (!checkAnyValueTransId(transId, anyValue))
+            {
+              g_err << "ERROR : TransId and AnyValue mismatch.  "
+                    << "Transid : " << transId
+                    << ", AnyValue : " << anyValue
+                    << ", Expected AnyValue : "
+                    << (Uint32) ((transId >> 32) ^ transId)
+                    << endl;
+              abort();
+              return NDBT_FAILED;
+            }
+          }
+
 	  for (i= 0; i < n_columns; i++)
 	  {
 	    if (recAttr[i]->isNULL())

=== modified file 'storage/ndb/test/src/HugoOperations.cpp'
--- a/storage/ndb/test/src/HugoOperations.cpp	2011-05-25 13:19:02 +0000
+++ b/storage/ndb/test/src/HugoOperations.cpp	2011-05-25 14:31:47 +0000
@@ -400,6 +400,8 @@ int HugoOperations::pkUpdateRecord(Ndb*
     Uint32 partId;
     if(getPartIdForRow(pOp, r+recordNo, partId))
       pOp->setPartitionId(partId);
+
+    pOp->setAnyValue(getAnyValueForRowUpd(r+recordNo, updatesValue));
     
   }
   return NDBT_OK;
@@ -803,7 +805,8 @@ HugoOperations::HugoOperations(const Ndb
   UtilTransactions(_tab, idx),
   pIndexScanOp(NULL),
   calc(_tab),
-  m_quiet(false)
+  m_quiet(false),
+  avCallback(NULL)
 {
 }
 
@@ -1201,5 +1204,21 @@ HugoOperations::setNdbError(const NdbErr
   m_error.code = error.code ? error.code : 1;
 }
 
+void
+HugoOperations::setAnyValueCallback(AnyValueCallback avc)
+{
+  avCallback = avc;
+}
+
+Uint32
+HugoOperations::getAnyValueForRowUpd(int row, int update)
+{
+  if (avCallback == NULL)
+    return 0;
+
+  return (avCallback)(pTrans->getNdb(), pTrans,
+                      row, update);
+}
+
 template class Vector<HugoOperations::RsPair>;
 template class Vector<const NdbLockHandle*>;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (frazer.clement:4225 to 4226) Frazer Clement25 May