List:Internals« Previous MessageNext Message »
From:jonas Date:December 5 2005 10:38am
Subject:bk commit into 5.1 tree (jonas:1.1977)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1977 05/12/05 10:38:35 jonas@stripped +12 -0
  ndb -
    Introduce ROW GCI

  storage/ndb/tools/select_all.cpp
    1.28 05/12/05 10:38:33 jonas@stripped +20 -4
    Introduce ROWGCI

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
    1.96 05/12/05 10:38:33 jonas@stripped +20 -0
    Introduce ROWGCI

  storage/ndb/src/ndbapi/NdbDictionary.cpp
    1.43 05/12/05 10:38:33 jonas@stripped +0 -9
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
    1.26 05/12/05 10:38:33 jonas@stripped +8 -0
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
    1.19 05/12/05 10:38:32 jonas@stripped +11 -2
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
    1.25 05/12/05 10:38:32 jonas@stripped +1 -1
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
    1.32 05/12/05 10:38:32 jonas@stripped +4 -4
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
    1.12 05/12/05 10:38:32 jonas@stripped +2 -2
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
    1.8 05/12/05 10:38:32 jonas@stripped +7 -1
    Introduce ROWGCI

  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
    1.34 05/12/05 10:38:32 jonas@stripped +25 -4
    Introduce ROWGCI

  storage/ndb/include/ndbapi/NdbDictionary.hpp
    1.59 05/12/05 10:38:32 jonas@stripped +2 -1
    Introduce ROWGCI

  storage/ndb/include/kernel/AttributeHeader.hpp
    1.14 05/12/05 10:38:32 jonas@stripped +1 -0
    Introduce ROW GCI

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-ndb

--- 1.13/storage/ndb/include/kernel/AttributeHeader.hpp	2005-11-05 00:00:24 +01:00
+++ 1.14/storage/ndb/include/kernel/AttributeHeader.hpp	2005-12-05 10:38:32 +01:00
@@ -44,6 +44,7 @@
   STATIC_CONST( RECORDS_IN_RANGE = 0xFFF8 );
   STATIC_CONST( DISK_REF     = 0xFFF7 );
   STATIC_CONST( ROWID        = 0xFFF6 );
+  STATIC_CONST( ROW_GCI      = 0xFFF5 );
 
   // NOTE: in 5.1 ctors and init take size in bytes
 

--- 1.58/storage/ndb/include/ndbapi/NdbDictionary.hpp	2005-11-23 07:50:50 +01:00
+++ 1.59/storage/ndb/include/ndbapi/NdbDictionary.hpp	2005-12-05 10:38:32 +01:00
@@ -502,7 +502,8 @@
     static const Column * DISK_REF;
     static const Column * RECORDS_IN_RANGE;
     static const Column * ROWID;
-
+    static const Column * ROW_GCI;
+    
     int getSizeInBytes() const;
 #endif
     

--- 1.33/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2005-11-23 10:12:40 +01:00
+++ 1.34/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2005-12-05 10:38:32 +01:00
@@ -413,7 +413,8 @@
       SCAN_LOCK_EX   = 0x20,        // lock mode exclusive
       SCAN_LOCK_WAIT = 0x40,        // lock wait
       // any lock mode
-      SCAN_LOCK      = SCAN_LOCK_SH | SCAN_LOCK_EX
+      SCAN_LOCK      = SCAN_LOCK_SH | SCAN_LOCK_EX,
+      SCAN_NR        = 0x80        // Node recovery scan
     };
     Uint16 m_bits;
     
@@ -424,7 +425,10 @@
     Uint32 m_fragPtrI;
     Uint32 m_transId1;
     Uint32 m_transId2;
-    Uint32 m_savePointId;
+    union {
+      Uint32 m_savePointId;
+      Uint32 m_scanGCI;
+    };
     // lock waited for or obtained and not yet passed to LQH
     Uint32 m_accLockOp;
 
@@ -866,7 +870,12 @@
     Uint32 tabDescriptor;
     Uint32 m_real_order_descriptor;
     
-    bool checksumIndicator;
+    enum Bits
+    {
+      TR_Checksum = 0x1, // Need to be 1
+      TR_RowGCI   = 0x2
+    };
+    Uint16 m_bits;
     Uint16 total_rec_size; // Max total size for entire tuple in words
     
     /**
@@ -1175,7 +1184,9 @@
     STATIC_CONST( MM_GROWN    = 0x00400000 ); // Has MM part grown
     STATIC_CONST( FREE        = 0x00800000 ); // On free list of page
     STATIC_CONST( LCP_SKIP    = 0x01000000 ); // Should not be returned in LCP
-
+    STATIC_CONST( LCP_KEEP    = 0x02000000 ); // Is deleted but kept in LCP
+    STATIC_CONST( NR_LOCK     = 0x04000000 ); // Locked for NR copy
+    
     Uint32 get_tuple_version() const { 
       return m_header_bits & TUP_VERSION_MASK;
     }
@@ -1207,6 +1218,16 @@
 
     const Uint32* get_disk_ref_ptr(const Tablerec* tabPtrP) const {
       return m_data + tabPtrP->m_offsets[MM].m_disk_ref_offset;
+    }
+
+    Uint32 *get_mm_gci(const Tablerec* tabPtrP){
+      assert(tabPtrP->m_bits & Tablerec::TR_RowGCI);
+      return m_data + (tabPtrP->m_bits & Tablerec::TR_Checksum);
+    }
+
+    Uint32 *get_dd_gci(const Tablerec* tabPtrP, Uint32 mm){
+      assert(tabPtrP->m_bits & Tablerec::TR_RowGCI);
+      return m_data;
     }
   };
   

--- 1.7/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2005-11-23 07:57:33 +01:00
+++ 1.8/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2005-12-05 10:38:32 +01:00
@@ -288,7 +288,13 @@
   tuple_ptr->m_header_bits= copy_bits;
   tuple_ptr->m_operation_ptr_i= save;
   
-  if (regTabPtr->checksumIndicator) {
+  if (regTabPtr->m_bits & Tablerec::TR_RowGCI)
+  {
+    jam();
+    * tuple_ptr->get_mm_gci(regTabPtr) = gci;
+  }
+  
+  if (regTabPtr->m_bits & Tablerec::TR_Checksum) {
     jam();
     setChecksum(tuple_ptr, regTabPtr);
   }

--- 1.11/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp	2005-11-04 07:58:31 +01:00
+++ 1.12/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp	2005-12-05 10:38:32 +01:00
@@ -333,7 +333,7 @@
   out << "[Th " << hex << &th;
   out << " [op " << hex << th.data[i++] << "]";
   out << " [version " << hex << (Uint16)th.data[i++] << "]";
-  if (tab.checksumIndicator)
+  if (tab.m_bits & Dbtup::Tablerec::TR_Checksum)
     out << " [checksum " << hex << th.data[i++] << "]";
   out << " [nullbits";
   for (unsigned j = 0; j < tab.m_offsets[Dbtup::MM].m_null_words; j++)
@@ -380,7 +380,7 @@
 operator<<(NdbOut& out, const Dbtup::Tablerec& tab)
 {
   out << "[ total_rec_size: " << tab.total_rec_size
-      << " checksum: " << tab.checksumIndicator 
+      << " checksum: " << !!(tab.m_bits & Dbtup::Tablerec::TR_Checksum)
       << " attr: " << tab.m_no_of_attributes
       << " disk: " << tab.m_no_of_disk_attributes 
       << " mm: " << tab.m_offsets[Dbtup::MM]

--- 1.31/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2005-11-30 14:58:56 +01:00
+++ 1.32/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2005-12-05 10:38:32 +01:00
@@ -902,7 +902,7 @@
   Uint32 *dst;
   Uint32 dstLen, start_index;
   const BlockReference sendBref= req_struct->rec_blockref;
-  if (regTabPtr->checksumIndicator &&
+  if ((regTabPtr->m_bits & Tablerec::TR_Checksum) &&
       (calculateChecksum(req_struct->m_tuple_ptr, regTabPtr) != 0)) {
     jam();
     ndbout_c("here2");
@@ -989,7 +989,7 @@
    * Check consistency before update/delete
    */
   req_struct->m_tuple_ptr= org;
-  if (regTabPtr->checksumIndicator &&
+  if ((regTabPtr->m_bits & Tablerec::TR_Checksum) &&
       (calculateChecksum(req_struct->m_tuple_ptr, regTabPtr) != 0)) 
   {
     terrorCode= ZTUPLE_CORRUPTED_ERROR;
@@ -1060,7 +1060,7 @@
   }
   
   req_struct->m_tuple_ptr->set_tuple_version(tup_version);
-  if (regTabPtr->checksumIndicator) {
+  if (regTabPtr->m_bits & Tablerec::TR_Checksum) {
     jam();
     setChecksum(req_struct->m_tuple_ptr, regTabPtr);
   }
@@ -1449,7 +1449,7 @@
     disk_ptr->m_base_record_ref= ref.ref();
   }
   
-  if (regTabPtr->checksumIndicator) 
+  if (regTabPtr->m_bits & Tablerec::TR_Checksum) 
   {
     jam();
     setChecksum(req_struct->m_tuple_ptr, regTabPtr);

--- 1.24/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2005-11-23 07:57:33 +01:00
+++ 1.25/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2005-12-05 10:38:32 +01:00
@@ -590,7 +590,7 @@
   regTabPtr->tabDescriptor = RNIL;
   regTabPtr->readKeyArray = RNIL;
 
-  regTabPtr->checksumIndicator = false;
+  regTabPtr->m_bits = 0;
 
   regTabPtr->m_no_of_attributes = 0;
   regTabPtr->noOfKeyAttr = 0;

--- 1.18/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2005-11-23 07:57:33 +01:00
+++ 1.19/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2005-12-05 10:38:32 +01:00
@@ -61,6 +61,7 @@
   //Uint32 noOfNewAttr= (signal->theData[10] & 0xFFFF);
   /* DICT sends number of character sets in upper half */
   Uint32 noOfCharsets= (signal->theData[10] >> 16);
+  Uint32 gcpIndicator = signal->theData[13];
   Uint32 tablespace= signal->theData[14];
 
   Uint32 checksumIndicator= signal->theData[11];
@@ -175,7 +176,9 @@
 //-----------------------------------------------------------------------------
     fragOperPtr.p->definingFragment= true;
     regTabPtr.p->tableStatus= DEFINING;
-    regTabPtr.p->checksumIndicator= (checksumIndicator != 0 ? true : false);
+    regTabPtr.p->m_bits = 0;
+    regTabPtr.p->m_bits |= (checksumIndicator ? Tablerec::TR_Checksum : 0);
+    regTabPtr.p->m_bits |= (gcpIndicator ? Tablerec::TR_RowGCI : 0);
     
     regTabPtr.p->m_offsets[MM].m_disk_ref_offset= 0;
     regTabPtr.p->m_offsets[MM].m_null_words= 0;
@@ -437,11 +440,17 @@
    * Fix offsets
    */
   Uint32 pos[2] = { 0, 0 };
-  if(regTabPtr.p->checksumIndicator)
+  if (regTabPtr.p->m_bits & Tablerec::TR_Checksum)
   {
     pos[0]= 1; 
   }
 
+  if (regTabPtr.p->m_bits & Tablerec::TR_RowGCI)
+  {
+    pos[MM]++;
+    pos[DD]++;
+  }
+  
   regTabPtr.p->m_no_of_disk_attributes= 
     regTabPtr.p->m_attributes[DD].m_no_of_fixsize +
     regTabPtr.p->m_attributes[DD].m_no_of_varsize;

--- 1.25/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2005-11-23 07:57:33 +01:00
+++ 1.26/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2005-12-05 10:38:33 +01:00
@@ -1179,6 +1179,14 @@
     outBuffer[0] = req_struct->frag_page_id;
     outBuffer[1] = operPtr.p->m_tuple_location.m_page_idx;
     return 2;
+  case AttributeHeader::ROW_GCI:
+    if (tabptr.p->m_bits & Tablerec::TR_RowGCI)
+    {
+      Uint64 tmp = * req_struct->m_tuple_ptr->get_mm_gci(tabptr.p);
+      memcpy(outBuffer, &tmp, sizeof(tmp));
+      return 2;
+    }
+    return 0;
   default:
     return 0;
   }

--- 1.42/storage/ndb/src/ndbapi/NdbDictionary.cpp	2005-11-23 07:50:51 +01:00
+++ 1.43/storage/ndb/src/ndbapi/NdbDictionary.cpp	2005-12-05 10:38:33 +01:00
@@ -1503,12 +1503,3 @@
   return tmp;
 }
 
-const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT = 0;
-const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT_MEMORY = 0;
-const NdbDictionary::Column * NdbDictionary::Column::ROW_COUNT = 0;
-const NdbDictionary::Column * NdbDictionary::Column::COMMIT_COUNT = 0;
-const NdbDictionary::Column * NdbDictionary::Column::ROW_SIZE = 0;
-const NdbDictionary::Column * NdbDictionary::Column::RANGE_NO = 0;
-const NdbDictionary::Column * NdbDictionary::Column::DISK_REF = 0;
-const NdbDictionary::Column * NdbDictionary::Column::RECORDS_IN_RANGE = 0;
-const NdbDictionary::Column * NdbDictionary::Column::ROWID = 0;

--- 1.95/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2005-11-24 16:11:31 +01:00
+++ 1.96/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2005-12-05 10:38:33 +01:00
@@ -325,6 +325,12 @@
     col->m_impl.m_attrId = AttributeHeader::ROWID;
     col->m_impl.m_attrSize = 4;
     col->m_impl.m_arraySize = 2;
+  } else if(!strcmp(name, "NDB$ROW_GCI")){
+    col->setType(NdbDictionary::Column::Bigunsigned);
+    col->m_impl.m_attrId = AttributeHeader::ROW_GCI;
+    col->m_impl.m_attrSize = 8;
+    col->m_impl.m_arraySize = 1;
+    col->m_impl.m_nullable = true;
   } else {
     abort();
   }
@@ -898,6 +904,7 @@
       delete NdbDictionary::Column::DISK_REF;
       delete NdbDictionary::Column::RECORDS_IN_RANGE;
       delete NdbDictionary::Column::ROWID;
+      delete NdbDictionary::Column::ROW_GCI;
       NdbDictionary::Column::FRAGMENT= 0;
       NdbDictionary::Column::FRAGMENT_MEMORY= 0;
       NdbDictionary::Column::ROW_COUNT= 0;
@@ -907,6 +914,7 @@
       NdbDictionary::Column::DISK_REF= 0;
       NdbDictionary::Column::RECORDS_IN_RANGE= 0;
       NdbDictionary::Column::ROWID= 0;
+      NdbDictionary::Column::ROW_GCI= 0;
     }
     m_globalHash->unlock();
   } else {
@@ -985,6 +993,8 @@
 	NdbColumnImpl::create_pseudo("NDB$RECORDS_IN_RANGE");
       NdbDictionary::Column::ROWID= 
 	NdbColumnImpl::create_pseudo("NDB$ROWID");
+      NdbDictionary::Column::ROW_GCI= 
+	NdbColumnImpl::create_pseudo("NDB$ROW_GCI");
     }
     m_globalHash->unlock();
     return true;
@@ -3955,3 +3965,13 @@
 template class Vector<NdbTableImpl*>;
 template class Vector<NdbColumnImpl*>;
 
+const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT = 0;
+const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT_MEMORY = 0;
+const NdbDictionary::Column * NdbDictionary::Column::ROW_COUNT = 0;
+const NdbDictionary::Column * NdbDictionary::Column::COMMIT_COUNT = 0;
+const NdbDictionary::Column * NdbDictionary::Column::ROW_SIZE = 0;
+const NdbDictionary::Column * NdbDictionary::Column::RANGE_NO = 0;
+const NdbDictionary::Column * NdbDictionary::Column::DISK_REF = 0;
+const NdbDictionary::Column * NdbDictionary::Column::RECORDS_IN_RANGE = 0;
+const NdbDictionary::Column * NdbDictionary::Column::ROWID = 0;
+const NdbDictionary::Column * NdbDictionary::Column::ROW_GCI = 0;

--- 1.27/storage/ndb/tools/select_all.cpp	2005-11-25 15:16:30 +01:00
+++ 1.28/storage/ndb/tools/select_all.cpp	2005-12-05 10:38:33 +01:00
@@ -47,6 +47,7 @@
 static int _dumpDisk = 0;
 static int use_rowid = 0;
 static int nodata = 0;
+static int use_gci = 0;
 
 static struct my_option my_long_options[] =
 {
@@ -81,6 +82,9 @@
   { "rowid", 256, "Dump rowid",
     (gptr*) &use_rowid, (gptr*) &use_rowid, 0,
     GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, 
+  { "gci", 256, "Dump gci",
+    (gptr*) &use_gci, (gptr*) &use_gci, 0,
+    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, 
   { "tupscan", 't', "Scan in tup order",
     (gptr*) &_tup, (gptr*) &_tup, 0,
     GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, 
@@ -331,12 +335,18 @@
     if(_dumpDisk && disk)
       disk_ref = pOp->getValue(NdbDictionary::Column::DISK_REF);
 
-    NdbRecAttr * rowid= 0, *frag;
+    NdbRecAttr * rowid= 0, *frag = 0, *gci = 0;
     if (use_rowid)
     {
       frag = pOp->getValue(NdbDictionary::Column::FRAGMENT);
       rowid = pOp->getValue(NdbDictionary::Column::ROWID);
     }
+
+    if (use_gci)
+    {
+      gci = pOp->getValue(NdbDictionary::Column::ROW_GCI);
+    }
+    
     check = pTrans->execute(NdbTransaction::NoCommit);   
     if( check == -1 ) {
       const NdbError err = pTrans->getNdbError();
@@ -355,12 +365,15 @@
     if (rowid)
       ndbout << "ROWID\t";
     
+    if (gci)
+      ndbout << "\tGCI";
+    
     if (headers && !nodata)
       row->header(ndbout);
     
     if (disk_ref)
       ndbout << "\tDISK_REF";
-    
+
     ndbout << endl;
     
     int eof;
@@ -381,6 +394,9 @@
 	ndbout << "\t";
       }
       
+      if (gci)
+	ndbout << gci->u_64_value() << "\t";
+      
       if (!nodata)
 	ndbout << (*row);
       
@@ -391,8 +407,8 @@
 	       << " m_page: " << disk_ref->u_32_value() 
 	       << " m_page_idx: " << *(Uint16*)(disk_ref->aRef() + 4) << "
]";
       }
-
-      if (rowid || disk_ref || !nodata)
+      
+      if (rowid || disk_ref || gci || !nodata)
 	ndbout << endl;
       eof = pOp->nextResult();
     }
Thread
bk commit into 5.1 tree (jonas:1.1977)jonas5 Dec