List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 22 2010 8:23am
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas:3888 to 3889)
View as plain text  
 3889 Jonas Oreland	2010-10-22 [merge]
      ndb - merge 63 to 70

    modified:
      storage/ndb/tools/restore/consumer_restore.cpp
 3888 Martin Zaun	2010-10-21 [merge]
      merge from ndb-6.3 to ndb-7.0

    added:
      mysql-test/suite/ndb/r/ndb_restore_lossy_charbinary_conv.result
      mysql-test/suite/ndb/r/ndb_restore_lossy_integral_conv.result
      mysql-test/suite/ndb/r/ndb_restore_padding_preservation.result
      mysql-test/suite/ndb/t/ndb_restore_lossy_charbinary_conv.test
      mysql-test/suite/ndb/t/ndb_restore_lossy_integral_conv.test
      mysql-test/suite/ndb/t/ndb_restore_padding_preservation.test
    modified:
      storage/ndb/tools/restore/Restore.cpp
      storage/ndb/tools/restore/Restore.hpp
      storage/ndb/tools/restore/consumer_restore.cpp
      storage/ndb/tools/restore/consumer_restore.hpp
      storage/ndb/tools/restore/restore_main.cpp
=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp	2010-10-22 06:52:58 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp	2010-10-22 08:22:32 +0000
@@ -2413,16 +2413,6 @@ BackupRestore::check_compat_lossy(const 
   return ACT_LOSSY;
 }
 
-/**
- * Returns a negative integer, zero, or a positive integer as x is less than,
- * equal to, or greater than y.
- */
-static int
-compare(Uint32 x, Uint32 y)
-{
-  return (x < y ? -1 : (x > y ? 1 : 0));
-}
-
 AttrConvType
 BackupRestore::check_compat_sizes(const NDBCOL &old_col,
                                   const NDBCOL &new_col)
@@ -2974,10 +2964,7 @@ BackupRestore::convert_uint16_uint8(cons
   Uint16 old_data16;
   memcpy(&old_data16, old_data, 2);
   Uint8 new_data8;
-  if (old_data16 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data16 > UINT_MAX8) {
+  if (old_data16 > UINT_MAX8) {
     new_data8 = (Uint8)(UINT_MAX8);
     truncated = true;
   } else {
@@ -2996,10 +2983,7 @@ BackupRestore::convert_uint24_uint8(cons
 {
   Uint32 old_data24 = uint3korr((char*)old_data);
   Uint8 new_data8;
-  if (old_data24 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data24 > UINT_MAX8) {
+  if (old_data24 > UINT_MAX8) {
     new_data8 = (Uint8)(UINT_MAX8);
     truncated = true;
   } else {
@@ -3018,10 +3002,7 @@ BackupRestore::convert_uint24_uint16(con
 {
   Uint32 old_data24 = uint3korr((char*)old_data);
   Uint16 new_data16;
-  if (old_data24 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else if (old_data24 > UINT_MAX16) {
+  if (old_data24 > UINT_MAX16) {
     new_data16 = (Uint16)(UINT_MAX16);
     truncated = true;
   } else {
@@ -3041,10 +3022,7 @@ BackupRestore::convert_uint32_uint8(cons
   Uint32 old_data32;
   memcpy(&old_data32, old_data, 4);
   Uint8 new_data8;
-  if (old_data32 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data32 > UINT_MAX8) {
+  if (old_data32 > UINT_MAX8) {
     new_data8 = (Uint8)(UINT_MAX8);
     truncated = true;
   } else {
@@ -3064,10 +3042,7 @@ BackupRestore::convert_uint32_uint16(con
   Uint32 old_data32;
   memcpy(&old_data32, old_data, 4);
   Uint16 new_data16;
-  if (old_data32 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else if (old_data32 > UINT_MAX16) {
+  if (old_data32 > UINT_MAX16) {
     new_data16 = (Uint16)(UINT_MAX16);
     truncated = true;
   } else {
@@ -3087,10 +3062,7 @@ BackupRestore::convert_uint32_uint24(con
   Uint32 old_data32;
   memcpy(&old_data32, old_data, 4);
   Uint32 new_data24;
-  if (old_data32 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else if (old_data32 > UINT_MAX24) {
+  if (old_data32 > UINT_MAX24) {
     new_data24 = (Uint32)(UINT_MAX24);
     truncated = true;
   } else {
@@ -3110,10 +3082,7 @@ BackupRestore::convert_uint64_uint8(cons
   Uint64 old_data64;
   memcpy(&old_data64, old_data, 8);
   Uint8 new_data8;
-  if (old_data64 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX8) {
+  if (old_data64 > UINT_MAX8) {
     new_data8 = (Uint8)(UINT_MAX8);
     truncated = true;
   } else {
@@ -3133,10 +3102,7 @@ BackupRestore::convert_uint64_uint16(con
   Uint64 old_data64;
   memcpy(&old_data64, old_data, 8);
   Uint16 new_data16;
-  if (old_data64 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX16) {
+  if (old_data64 > UINT_MAX16) {
     new_data16 = (Uint16)(UINT_MAX16);
     truncated = true;
   } else {
@@ -3156,10 +3122,7 @@ BackupRestore::convert_uint64_uint24(con
   Uint64 old_data64;
   memcpy(&old_data64, old_data, 8);
   Uint32 new_data24;
-  if (old_data64 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX24) {
+  if (old_data64 > UINT_MAX24) {
     new_data24 = (Uint32)(UINT_MAX24);
     truncated = true;
   } else {
@@ -3179,10 +3142,7 @@ BackupRestore::convert_uint64_uint32(con
   Uint64 old_data64;
   memcpy(&old_data64, old_data, 8);
   Uint32 new_data32;
-  if (old_data64 < 0) {
-    new_data32 = (Uint32)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX32) {
+  if (old_data64 > UINT_MAX32) {
     new_data32 = (Uint32)(UINT_MAX32);
     truncated = true;
   } else {


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101022082232-pewjlrss82052209.bundle
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas:3888 to 3889) Jonas Oreland22 Oct