List:Commits« Previous MessageNext Message »
From:jonas Date:April 16 2007 6:42am
Subject:bk commit into 5.1 tree (jonas:1.2534)
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@stripped, 2007-04-16 08:42:04+02:00, jonas@stripped +9 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/check/51-telco0
  into  perch.ndb.mysql.com:/home/jonas/src/check/51-telco-rp
  MERGE: 1.2521.1.11

  storage/ndb/include/kernel/AttributeHeader.hpp@stripped, 2007-04-16 08:42:01+02:00, jonas@stripped +2 -2
    merge
    MERGE: 1.17.1.1

  storage/ndb/include/ndbapi/Ndb.hpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.63.1.1

  storage/ndb/include/ndbapi/NdbReceiver.hpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.18.1.1

  storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp@stripped, 2007-04-16 08:42:01+02:00, jonas@stripped +5 -4
    merge
    MERGE: 1.37.1.1

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.170.1.1

  storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.75.1.1

  storage/ndb/src/ndbapi/NdbImpl.hpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.22.1.1

  storage/ndb/src/ndbapi/NdbReceiver.cpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.20.1.2

  storage/ndb/src/ndbapi/Ndblist.cpp@stripped, 2007-04-16 08:39:18+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.20.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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/check/51-telco-rp/RESYNC

--- 1.18/storage/ndb/include/kernel/AttributeHeader.hpp	2007-04-16 08:42:09 +02:00
+++ 1.19/storage/ndb/include/kernel/AttributeHeader.hpp	2007-04-16 08:42:09 +02:00
@@ -45,9 +45,10 @@
   STATIC_CONST( ROWID        = 0xFFF6 );
   STATIC_CONST( ROW_GCI      = 0xFFF5 );
   STATIC_CONST( FRAGMENT_VARSIZED_MEMORY = 0xFFF4 );
-  // 0xFFF3  to be used for read packed when merged
+  STATIC_CONST( READ_PACKED  = 0xFFF3 );
   STATIC_CONST( ANY_VALUE    = 0xFFF2 );
   STATIC_CONST( COPY_ROWID   = 0xFFF1 );
+  STATIC_CONST( READ_ALL     = 0xFFF0 );
   
   // NOTE: in 5.1 ctors and init take size in bytes
 

--- 1.64/storage/ndb/include/ndbapi/Ndb.hpp	2007-04-16 08:42:09 +02:00
+++ 1.65/storage/ndb/include/ndbapi/Ndb.hpp	2007-04-16 08:42:09 +02:00
@@ -1629,6 +1629,7 @@
   NdbBlob*              getNdbBlob();// Get a blob handle etc
 
   void			releaseSignal(NdbApiSignal* anApiSignal);
+  void                  releaseSignals(Uint32, NdbApiSignal*, NdbApiSignal*);
   void                  releaseSignalsInList(NdbApiSignal** pList);
   void			releaseNdbScanRec(NdbReceiver* aNdbScanRec);
   void			releaseNdbLabel(NdbLabel* anNdbLabel);

--- 1.19/storage/ndb/include/ndbapi/NdbReceiver.hpp	2007-04-16 08:42:09 +02:00
+++ 1.20/storage/ndb/include/ndbapi/NdbReceiver.hpp	2007-04-16 08:42:09 +02:00
@@ -97,6 +97,8 @@
   
   bool nextResult() const { return m_current_row < m_result_rows; }
   NdbRecAttr* copyout(NdbReceiver&);
+  Uint32 receive_packed(NdbRecAttr**, Uint32 bmlen, 
+                        const Uint32* aDataPtr, Uint32 aLength);
 };
 
 #ifdef NDB_NO_DROPPED_SIGNAL

--- 1.46/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-04-16 08:42:09 +02:00
+++ 1.47/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-04-16 08:42:09 +02:00
@@ -2284,6 +2284,11 @@
     req_struct->log_size = RlogSize + 2;
     return 1;
   }
+  case AttributeHeader::COPY_ROWID:
+    sz = 2;
+    outBuffer[1] = operPtr.p->m_copy_tuple_location.m_page_no;
+    outBuffer[2] = operPtr.p->m_copy_tuple_location.m_page_idx;
+    break;
   default:
     return 0;
   }

--- 1.173/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-16 08:42:09 +02:00
+++ 1.174/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-16 08:42:09 +02:00
@@ -2200,6 +2200,7 @@
         DBUG_RETURN(743);
       }
     }
+    col->m_orgAttrSize = attrDesc.AttributeSize;
     col->m_attrSize = (1 << attrDesc.AttributeSize) / 8;
     col->m_arraySize = attrDesc.AttributeArraySize;
     col->m_arrayType = attrDesc.AttributeArrayType;

--- 1.76/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2007-04-16 08:42:09 +02:00
+++ 1.77/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2007-04-16 08:42:09 +02:00
@@ -95,6 +95,7 @@
   /**
    * Internal types and sizes, and aggregates
    */
+  Uint32 m_orgAttrSize;
   Uint32 m_attrSize;            // element size (size when arraySize==1)
   Uint32 m_arraySize;           // length or maxlength+1/2 for Var* types
   Uint32 m_arrayType;           // NDB_ARRAYTYPE_FIXED or _VAR

--- 1.23/storage/ndb/src/ndbapi/NdbImpl.hpp	2007-04-16 08:42:09 +02:00
+++ 1.24/storage/ndb/src/ndbapi/NdbImpl.hpp	2007-04-16 08:42:09 +02:00
@@ -40,6 +40,7 @@
   int fill(Ndb*, Uint32 cnt);
   T* seize(Ndb*);
   void release(T*);
+  void release(Uint32 cnt, T* head, T* tail);
   void clear();
   Uint32 get_sizeof() const { return sizeof(T); }
   T * m_free_list;
@@ -289,6 +290,26 @@
     obj = (T*)obj->next();
     delete curr;
     m_alloc_cnt--;
+  }
+}
+
+template<class T>
+inline
+void
+Ndb_free_list_t<T>::release(Uint32 cnt, T* head, T* tail)
+{
+  if (cnt)
+  {
+#ifdef VM_TRACE
+    {
+      T* tmp = head;
+      while (tmp != 0 && tmp != tail) tmp = (T*)tmp->next();
+      assert(tmp == tail);
+    }
+#endif
+    tail->next(m_free_list);
+    m_free_list = head;
+    m_free_cnt += cnt;
   }
 }
 

--- 1.21/storage/ndb/src/ndbapi/NdbReceiver.cpp	2007-04-16 08:42:09 +02:00
+++ 1.22/storage/ndb/src/ndbapi/NdbReceiver.cpp	2007-04-16 08:42:09 +02:00
@@ -238,6 +238,103 @@
   return start;
 }
 
+static
+inline
+const Uint8*
+pad(const Uint8* src, Uint32 align, Uint32 bitPos)
+{
+  UintPtr ptr = UintPtr(src);
+  switch(align){
+  case 0:
+  case 5:
+  case 6:
+    return (Uint8*)(((ptr + 3) & ~(UintPtr)3) + 4 * ((bitPos + 31) >> 5));
+  default:
+    return src + 4 * ((bitPos + 31) >> 5);
+  }
+}
+
+static
+void
+handle_packed_bit(const Uint8* _src, Uint32 pos, Uint32 len, NdbRecAttr* curr)
+{
+  Uint32 * src = (Uint32*)_src;
+  Uint32 * dst = (Uint32*)curr->aRef();
+  assert((UintPtr(dst) & 3) == 0);
+  assert((UintPtr(src) & 3) == 0);
+  BitmaskImpl::getField(1 + ((len + 31) >> 5), src, pos, len, dst);
+}
+
+Uint32
+NdbReceiver::receive_packed(NdbRecAttr** recAttr, 
+			    Uint32 bmlen, 
+			    const Uint32* aDataPtr, 
+			    Uint32 aLength)
+{
+  NdbRecAttr* currRecAttr = *recAttr;
+  const Uint8 *src = (Uint8*)(aDataPtr + bmlen);
+  Uint32 bitPos = 0;
+  for (Uint32 i = 0, attrId = 0; i<32*bmlen; i++, attrId++)
+  {
+    if (BitmaskImpl::get(bmlen, aDataPtr, i))
+    {
+      const NdbColumnImpl & col = 
+	NdbColumnImpl::getImpl(* currRecAttr->getColumn());
+      if (unlikely(attrId != (Uint32)col.m_attrId))
+        goto err;
+      if (col.m_nullable)
+      {
+	if (BitmaskImpl::get(bmlen, aDataPtr, ++i))
+	{
+	  currRecAttr->setNULL();
+	  currRecAttr = currRecAttr->next();
+	  continue;
+	}
+      }
+      Uint32 align = col.m_orgAttrSize;
+      Uint32 attrSize = col.m_attrSize;
+      Uint32 array = col.m_arraySize;
+      Uint32 len = col.m_length;
+      Uint32 sz = attrSize * array;
+      Uint32 arrayType = col.m_arrayType;
+      
+      switch(align){
+      case 0: // Bit
+        src = pad(src, 0, 0);
+	handle_packed_bit(src, bitPos, len, currRecAttr);
+	src += 4 * ((bitPos + len) >> 5);
+	bitPos = (bitPos + len) & 31;
+        goto next;
+      default:
+        src = pad(src, align, bitPos);
+      }
+      switch(arrayType){
+      case NDB_ARRAYTYPE_FIXED:
+        break;
+      case NDB_ARRAYTYPE_SHORT_VAR:
+        sz = 1 + src[0];
+        break;
+      case NDB_ARRAYTYPE_MEDIUM_VAR:
+	sz = 2 + src[0] + 256 * src[1];
+        break;
+      default:
+        goto err;
+      }
+      
+      bitPos = 0;
+      currRecAttr->receive_data((Uint32*)src, sz);
+      src += sz;
+  next:
+      currRecAttr = currRecAttr->next();
+    }
+  }
+  * recAttr = currRecAttr;
+  return ((Uint32*)pad(src, 0, bitPos)) - aDataPtr;
+
+err:
+  abort();
+}
+
 int
 NdbReceiver::execTRANSID_AI(const Uint32* aDataPtr, Uint32 aLength)
 {
@@ -247,7 +344,17 @@
     AttributeHeader ah(* aDataPtr++);
     const Uint32 tAttrId = ah.getAttributeId();
     const Uint32 tAttrSize = ah.getByteSize();
-
+    
+    if (tAttrId == AttributeHeader::READ_PACKED)
+    {
+      NdbRecAttr* tmp = currRecAttr;
+      Uint32 len = receive_packed(&tmp, tAttrSize>>2, aDataPtr, aLength); 
+      aDataPtr += len;
+      used += len;
+      currRecAttr = tmp;
+      continue;
+    }
+    
     /**
      * Set all results to NULL if  not found...
      */

--- 1.21/storage/ndb/src/ndbapi/Ndblist.cpp	2007-04-16 08:42:09 +02:00
+++ 1.22/storage/ndb/src/ndbapi/Ndblist.cpp	2007-04-16 08:42:09 +02:00
@@ -422,6 +422,15 @@
 }
 
 void
+Ndb::releaseSignals(Uint32 cnt, NdbApiSignal* head, NdbApiSignal* tail)
+{
+#ifdef POORMANSPURIFY
+  creleaseSignals += cnt;
+#endif
+  theImpl->theSignalIdleList.release(cnt, head, tail);
+}
+
+void
 Ndb::releaseSignalsInList(NdbApiSignal** pList){
   NdbApiSignal* tmp;
   while (*pList != NULL){
Thread
bk commit into 5.1 tree (jonas:1.2534)jonas16 Apr