List:Commits« Previous MessageNext Message »
From:pekka Date:March 25 2008 10:37am
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-25 11:37:45+02:00, pekka@stripped +1 -0
  ndb - bug#34515 fix

  storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp@stripped, 2008-03-25 11:36:44+02:00,
pekka@stripped +17 -0
    bug#34515 - on update of fixed attribute, zero unused bytes in last word.
    needed for DBTUX Decimal compare.  (variable attribute case ignored.)

diff -Nrup a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-10-25 11:59:16 +03:00
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2008-03-25 11:36:44 +02:00
@@ -988,6 +988,23 @@ Dbtup::updateFixedSizeTHManyWordNotNULL(
                        &inBuffer[indexBuf + 1],
                        noOfWords);
       
+      /*
+       * bug#34515 - zero unused bytes in last word
+       * 1) writer should zero them
+       * 2) do it here always to avoid randomness
+       * 3) reader should ignore unused bytes
+       * Restart code can fail 1) (not analyzed).
+       * DBTUX can fail 3) in Decimal comparisons.
+       * This will be fixed in DBTUX cleanup in 6.x.
+       */
+      Uint32 noOfBytes = AttributeDescriptor::getSizeInBytes(attrDescriptor);
+      Uint32 unused = (noOfWords << 2) - noOfBytes;
+      if (unused != 0) {
+        ndbassert(unused < 4);
+        char* base = (char*)&tuple_header[updateOffset];
+        memset(&base[noOfBytes], 0, unused);
+      }
+
       return true;
     } else {
       jam();
Thread
bk commit into 5.1 tree (pekka:1.2549) BUG#34515pekka25 Mar