List:Commits« Previous MessageNext Message »
From:tomas Date:April 3 2007 12:52pm
Subject:bk commit into 5.1 tree (tomas:1.2518)
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 14:52:50+02:00, tomas@stripped +11 -0
  Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
  into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco
  MERGE: 1.2494.1.50

  sql/ha_ndbcluster.cc@stripped, 2007-04-03 14:52:44+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.408.1.24

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-04-03 14:52:44+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.104.3.3

  storage/ndb/include/ndbapi/NdbDictionary.hpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.87.2.2

  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.55.1.10

  storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.15.1.3

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.50.1.8

  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.35.1.7

  storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.50.1.11

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.159.2.1

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.80.1.5

  storage/ndb/src/ndbapi/ndb_cluster_connection.cpp@stripped, 2007-04-03 14:52:45+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.49.2.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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-telco/RESYNC

--- 1.90/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-03-23 17:13:20 +01:00
+++ 1.91/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-04-03 14:52:45 +02:00
@@ -535,6 +535,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.65/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-04-02 09:44:07 +02:00
+++ 1.66/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-04-03 14:52:45 +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.19/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp	2007-04-02 09:44:07 +02:00
+++ 1.20/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp	2007-04-03 14:52:45 +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.64/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-04-02 09:44:07 +02:00
+++ 1.65/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-04-03 14:52:45 +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.45/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-04-02 09:33:33 +02:00
+++ 1.46/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-04-03 14:52:45 +02:00
@@ -683,6 +683,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.64/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-03-27 14:36:00 +02:00
+++ 1.65/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-04-03 14:52:45 +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.167/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-02 22:32:56 +02:00
+++ 1.168/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-03 14:52:45 +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();
   }
@@ -5300,3 +5305,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.86/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2007-03-21 15:39:30 +01:00
+++ 1.87/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2007-04-03 14:52:45 +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.440/sql/ha_ndbcluster.cc	2007-04-03 09:54:49 +02:00
+++ 1.441/sql/ha_ndbcluster.cc	2007-04-03 14:52:44 +02:00
@@ -2732,6 +2732,9 @@
     op->setValue(no_fields, part_func_value);
   }
 
+  if (thd->slave_thread)
+    op->setAnyValue(thd->server_id);
+
   m_rows_changed++;
 
   /*
@@ -3012,6 +3015,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();
@@ -3067,6 +3074,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);
@@ -3096,6 +3106,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.52/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-04-02 22:32:56 +02:00
+++ 1.53/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-04-03 14:52:45 +02:00
@@ -351,6 +351,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);
 
@@ -409,6 +411,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;
@@ -420,6 +423,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.110/sql/ha_ndbcluster_binlog.cc	2007-04-03 07:25:48 +02:00
+++ 1.111/sql/ha_ndbcluster_binlog.cc	2007-04-03 14:52:44 +02:00
@@ -3209,8 +3209,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);
 
@@ -3255,7 +3259,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]);
@@ -3295,7 +3299,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]);
@@ -3325,7 +3329,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
@@ -3345,7 +3350,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,
@@ -3602,6 +3607,14 @@
   /*
     Main NDB Injector loop
   */
+  {
+    /*
+      Always insert a GAP event as we cannot know what has happened in the cluster
+      while not being connected.
+    */
+    LEX_STRING const msg= { C_STRING_WITH_LEN("Cluster connect") };
+    inj->record_incident(thd, INCIDENT_LOST_EVENTS, msg);
+  }
   {
     thd->proc_info= "Waiting for ndbcluster to start";
 
Thread
bk commit into 5.1 tree (tomas:1.2518)tomas3 Apr