List:Commits« Previous MessageNext Message »
From:pekka Date:March 27 2008 12:26pm
Subject:bk commit into 5.1 tree (pekka:1.2549) BUG#34515
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka.  When pekka 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, 2008-03-27 13:25:56+02:00, pekka@stripped +3 -0
  ndb - bug#34515 - use bytesize (not wordsize) in TUX bounds and comparisons

  storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp@stripped, 2008-03-27 13:25:25+02:00,
pekka@stripped +6 -4
    bug#34515 - use bytesize (not wordsize) in TUX bounds and comparisons

  storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp@stripped, 2008-03-27 13:25:25+02:00,
pekka@stripped +6 -2
    bug#34515 - use bytesize (not wordsize) in TUX bounds and comparisons

  storage/ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2008-03-27 13:25:25+02:00,
pekka@stripped +1 -1
    bug#34515 - use bytesize (not wordsize) in TUX bounds and comparisons

diff -Nrup a/storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
b/storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp	2006-12-23 21:20:17 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp	2008-03-27 13:25:25 +02:00
@@ -53,7 +53,8 @@ Dbtux::cmpSearchKey(const Frag& frag, un
         ndbrequire(ah(searchKey).getAttributeId() == descAttr.m_primaryAttrId);
         ndbrequire(ah(entryData).getAttributeId() == descAttr.m_primaryAttrId);
         // sizes
-        const unsigned size1 = ah(searchKey).getDataSize();
+        const unsigned bytes1 = ah(searchKey).getByteSize();
+        const unsigned bytes2 = min(ah(entryData).getByteSize(), len2 << 2);
         const unsigned size2 = min(ah(entryData).getDataSize(), len2);
         len2 -= size2;
         // compare
@@ -61,7 +62,7 @@ Dbtux::cmpSearchKey(const Frag& frag, un
         const Uint32* const p1 = &searchKey[AttributeHeaderSize];
         const Uint32* const p2 = &entryData[AttributeHeaderSize];
         const bool full = (maxlen == MaxAttrDataSize);
-        ret = (*cmp)(0, p1, size1 << 2, p2, size2 << 2, full);
+        ret = (*cmp)(0, p1, bytes1, p2, bytes2, full);
         if (ret != 0) {
           jam();
           break;
@@ -138,7 +139,8 @@ Dbtux::cmpScanBound(const Frag& frag, un
         const DescAttr& descAttr = descEnt.m_descAttr[index];
         ndbrequire(ah(entryData).getAttributeId() == descAttr.m_primaryAttrId);
         // sizes
-        const unsigned size1 = ah(boundInfo).getDataSize();
+        const unsigned bytes1 = ah(boundInfo).getByteSize();
+        const unsigned bytes2 = min(ah(entryData).getByteSize(), len2 << 2);
         const unsigned size2 = min(ah(entryData).getDataSize(), len2);
         len2 -= size2;
         // compare
@@ -146,7 +148,7 @@ Dbtux::cmpScanBound(const Frag& frag, un
         const Uint32* const p1 = &boundInfo[AttributeHeaderSize];
         const Uint32* const p2 = &entryData[AttributeHeaderSize];
         const bool full = (maxlen == MaxAttrDataSize);
-        int ret = (*cmp)(0, p1, size1 << 2, p2, size2 << 2, full);
+        int ret = (*cmp)(0, p1, bytes1, p2, bytes2, full);
         if (ret != 0) {
           jam();
           return ret;
diff -Nrup a/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
b/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp	2008-01-28 03:56:41 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp	2008-03-27 13:25:25 +02:00
@@ -146,6 +146,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal
     const unsigned type = data[offset];
     const AttributeHeader* ah = (const AttributeHeader*)&data[offset + 1];
     const Uint32 attrId = ah->getAttributeId();
+    const Uint32 byteSize = ah->getByteSize();
     const Uint32 dataSize = ah->getDataSize();
     if (type > 4 || attrId >= index.m_numAttrs || dstPos + 2 + dataSize >
dstSize) {
       jam();
@@ -157,6 +158,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal
     xfrmData[dstPos + 0] = data[offset + 0];
     xfrmData[dstPos + 1] = data[offset + 1];
     // copy bound value
+    Uint32 dstBytes = 0;
     Uint32 dstWords = 0;
     if (! ah->isNULL()) {
       jam();
@@ -174,7 +176,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal
       }
       Uint32 srcBytes = lb + len;
       Uint32 srcWords = (srcBytes + 3) / 4;
-      if (srcWords != dataSize) {
+      if (srcBytes != byteSize) {
         jam();
         scan.m_state = ScanOp::Invalid;
         sig->errorCode = TuxBoundInfo::InvalidAttrInfo;
@@ -183,6 +185,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal
       uchar* dstPtr = (uchar*)&xfrmData[dstPos + 2];
       if (descAttr.m_charset == 0) {
         memcpy(dstPtr, srcPtr, srcWords << 2);
+        dstBytes = srcBytes;
         dstWords = srcWords;
       } else {
         jam();
@@ -200,6 +203,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal
         }
         int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len);
         ndbrequire(n != -1);
+        dstBytes = n;
         while ((n & 3) != 0) {
           dstPtr[n++] = 0;
         }
@@ -234,7 +238,7 @@ Dbtux::execTUX_BOUND_INFO(Signal* signal
       } else {
         // fix length
         AttributeHeader* ah = (AttributeHeader*)&xfrmData[dstPos + 1];
-        ah->setDataSize(dstWords);
+        ah->setByteSize(dstBytes);
         // enter new bound
         jam();
         b.type2 = type2;
diff -Nrup a/storage/ndb/src/ndbapi/NdbScanOperation.cpp
b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2007-12-18 14:40:27 +02:00
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2008-03-27 13:25:25 +02:00
@@ -1195,7 +1195,7 @@ NdbIndexScanOperation::setBound(const Nd
     // insert attribute header
     Uint32 tIndexAttrId = tAttrInfo->m_attrId;
     Uint32 sizeInWords = (len + 3) / 4;
-    AttributeHeader ah(tIndexAttrId, sizeInWords << 2);
+    AttributeHeader ah(tIndexAttrId, len);
     const Uint32 ahValue = ah.m_value;
 
     const Uint32 align = (UintPtr(aValue) & 7);
Thread
bk commit into 5.1 tree (pekka:1.2549) BUG#34515pekka27 Mar 2008