List:Commits« Previous MessageNext Message »
From:tomas Date:May 9 2007 2:31pm
Subject:bk commit into 5.0 tree (tomas:1.2477) BUG#28287
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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@stripped, 2007-05-09 14:31:22+02:00, tomas@stripped +2 -0
  Bug #28287 Sign problem in test "ndb_restore_print"
    - corrected previous patch
    - some platforms do strange things with char... use Int8 to be sure of signedness

  ndb/include/ndbapi/NdbRecAttr.hpp@stripped, 2007-05-09 14:31:20+02:00,
tomas@stripped +30 -2
    Bug #28287 Sign problem in test "ndb_restore_print"
      - corrected previous patch
      - some platforms do strange things with char... use Int8 to be sure of signedness

  ndb/src/ndbapi/NdbRecAttr.cpp@stripped, 2007-05-09 14:31:20+02:00,
tomas@stripped +3 -3
    Bug #28287 Sign problem in test "ndb_restore_print"
      - corrected previous patch
      - some platforms do strange things with char... use Int8 to be sure of signedness

# 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:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.0-ndb

--- 1.22/ndb/include/ndbapi/NdbRecAttr.hpp	2007-05-09 10:22:24 +02:00
+++ 1.23/ndb/include/ndbapi/NdbRecAttr.hpp	2007-05-09 14:31:20 +02:00
@@ -164,7 +164,14 @@
    *
    * @return  Char value.
    */           
-  Int8  char_value() const;           
+  char  char_value() const;           
+
+  /**
+   * Get value stored in NdbRecAttr object.
+   *
+   * @return  Int8 value.
+   */           
+  Int8  int8_value() const;           
 
   /**
    * Get value stored in NdbRecAttr object.
@@ -204,6 +211,13 @@
   /**
    * Get value stored in NdbRecAttr object.
    *
+   * @return  Uint8 value.
+   */   
+  Uint8 u_8_value() const;
+
+  /**
+   * Get value stored in NdbRecAttr object.
+   *
    * @return  Float value.
    */
   float float_value() const;         
@@ -340,9 +354,16 @@
 }
 
 inline
-Int8
+char
 NdbRecAttr::char_value() const
 {
+  return *(char*)theRef;
+}
+
+inline
+Int8
+NdbRecAttr::int8_value() const
+{
   return *(Int8*)theRef;
 }
 
@@ -363,6 +384,13 @@
 inline
 Uint8
 NdbRecAttr::u_char_value() const
+{
+  return *(Uint8*)theRef;
+}
+
+inline
+Uint8
+NdbRecAttr::u_8_value() const
 {
   return *(Uint8*)theRef;
 }

--- 1.35/ndb/src/ndbapi/NdbRecAttr.cpp	2007-04-12 21:34:23 +02:00
+++ 1.36/ndb/src/ndbapi/NdbRecAttr.cpp	2007-05-09 14:31:20 +02:00
@@ -272,7 +272,7 @@
       out << r.u_short_value();
       break;
     case NdbDictionary::Column::Tinyunsigned:
-      out << (unsigned) r.u_char_value();
+      out << (unsigned) r.u_8_value();
       break;
     case NdbDictionary::Column::Bigint:
       out << r.int64_value();
@@ -287,7 +287,7 @@
       out << r.short_value();
       break;
     case NdbDictionary::Column::Tinyint:
-      out << (int) r.char_value();
+      out << (int) r.int8_value();
       break;
     case NdbDictionary::Column::Binary:
       if (!f.hex_format)
@@ -413,7 +413,7 @@
     break;
     case NdbDictionary::Column::Year:
     {
-      uint year = 1900 + r.u_char_value();
+      uint year = 1900 + r.u_8_value();
       char buf[40];
       sprintf(buf, "%04d", year);
       out << buf;
Thread
bk commit into 5.0 tree (tomas:1.2477) BUG#28287tomas9 May