List:Commits« Previous MessageNext Message »
From:tomas Date:March 7 2007 3:43am
Subject:bk commit into 5.1 tree (tomas:1.2425)
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
  1.2425 07/03/07 10:43:21 tomas@stripped +1 -0
  Merge poseidon.mysql.com:/home/tomas/mysql-5.0-telco-gca
  into  poseidon.mysql.com:/home/tomas/mysql-5.1-telco-gca

  storage/ndb/src/ndbapi/NdbRecAttr.cpp
    1.33 07/03/07 10:43:15 tomas@stripped +5 -125
    manual merge, use local copy

  storage/ndb/src/ndbapi/NdbRecAttr.cpp
    1.20.9.2 07/03/07 10:41:34 tomas@stripped +0 -0
    Merge rename: ndb/src/ndbapi/NdbRecAttr.cpp -> storage/ndb/src/ndbapi/NdbRecAttr.cpp

# 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:	poseidon.mysql.com
# Root:	/home/tomas/mysql-5.1-telco-gca/RESYNC

--- 1.20.9.1/ndb/src/ndbapi/NdbRecAttr.cpp	2007-03-07 10:37:19 +07:00
+++ 1.33/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2007-03-07 10:43:15 +07:00
@@ -37,6 +37,7 @@ NdbRecAttr::setup(const class NdbDiction
 {
   return setup(&(col->m_impl), aValue);
 }
+
 int
 NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue)
 {
@@ -47,11 +48,8 @@ NdbRecAttr::setup(const NdbColumnImpl* a
   m_column = anAttrInfo;
 
   theAttrId = anAttrInfo->m_attrId;
-  theAttrSize = tAttrSize;
-  theArraySize = tArraySize;
+  m_size_in_bytes = tAttrByteSize;
   theValue = aValue;
-  theNULLind = 0;
-  m_nullable = anAttrInfo->m_nullable;
 
   if (theStorageX)
     delete[] theStorageX;
@@ -92,7 +90,7 @@ NdbRecAttr::copyout()
   char* tRef = (char*)theRef;
   char* tValue = theValue;
   if (tRef != tValue && tRef != NULL && tValue != NULL) {
-    Uint32 n = theAttrSize * theArraySize;
+    Uint32 n = m_size_in_bytes;
     while (n-- > 0) {
       *tValue++ = *tRef++;
     }
@@ -104,12 +102,10 @@ NdbRecAttr::clone() const {
   NdbRecAttr * ret = new NdbRecAttr(0);
 
   ret->theAttrId = theAttrId;
-  ret->theNULLind = theNULLind;
-  ret->theAttrSize = theAttrSize;
-  ret->theArraySize = theArraySize;
+  ret->m_size_in_bytes = m_size_in_bytes;
   ret->m_column = m_column;
   
-  Uint32 n = theAttrSize * theArraySize;  
+  Uint32 n = m_size_in_bytes;
   if(n <= 32){
     ret->theRef = (char*)&ret->theStorage[0];
     ret->theStorageX = 0;
@@ -125,17 +121,19 @@ NdbRecAttr::clone() const {
 
 bool
 NdbRecAttr::receive_data(const Uint32 * data, Uint32 sz){
-  const Uint32 n = (theAttrSize * theArraySize + 3) >> 2;  
-  if(n == sz){
-    theNULLind = 0;
+  const Uint32 n = m_size_in_bytes;
+  if(sz)
+  {
     if(!copyoutRequired())
-      memcpy(theRef, data, 4 * sz);
+      memcpy(theRef, data, sz);
     else
-      memcpy(theValue, data, theAttrSize * theArraySize);
-    return true;
-  } else if(sz == 0){
-    setNULL();
+      memcpy(theValue, data, sz);
+    m_size_in_bytes= sz;
     return true;
+  } 
+  else 
+  {
+    return setNULL();
   }
   return false;
 }
@@ -200,7 +198,7 @@ NdbOut& operator<<(NdbOut& out, const Nd
       out << hex << "H'" << r.u_32_value() << dec;
       break;
     case NdbDictionary::Column::Unsigned:
-      out << r.u_32_value();
+      out << *((Uint32*)r.aRef() + j);
       break;
     case NdbDictionary::Column::Smallunsigned:
       out << r.u_short_value();
@@ -221,12 +219,12 @@ NdbOut& operator<<(NdbOut& out, const Nd
       out << (int) r.char_value();
       break;
     case NdbDictionary::Column::Binary:
-      j = r.arraySize();
+      j = r.get_size_in_bytes();
       ndbrecattr_print_string(out,"Binary", r.aRef(), j);
       break;
     case NdbDictionary::Column::Char:
-      j = length;
-      ndbrecattr_print_string(out,"Char", r.aRef(), r.arraySize());
+      j = r.get_size_in_bytes();
+      ndbrecattr_print_string(out,"Char", r.aRef(), j);
       break;
     case NdbDictionary::Column::Varchar:
     {
@@ -352,10 +350,10 @@ NdbOut& operator<<(NdbOut& out, const Nd
       memcpy(&head, r.aRef(), sizeof(head));
       out << head.length << ":";
       const unsigned char* p = (const unsigned char*)r.aRef() + sizeof(head);
-      if (r.arraySize() < sizeof(head))
+      if (r.get_size_in_bytes() < sizeof(head))
         out << "***error***"; // really cannot happen
       else {
-        unsigned n = r.arraySize() - sizeof(head);
+        unsigned n = r.get_size_in_bytes() - sizeof(head);
         for (unsigned k = 0; k < n && k < head.length; k++) {
           if (r.getType() == NdbDictionary::Column::Blob)
             out.print("%02X", (int)p[k]);
Thread
bk commit into 5.1 tree (tomas:1.2425)tomas7 Mar