List:Internals« Previous MessageNext Message »
From:ramil Date:November 29 2005 2:07pm
Subject:bk commit into 5.0 tree (ramil:1.1994) BUG#12956
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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.1994 05/11/29 18:06:58 ramil@stripped +2 -0
  Addition to fix for bug #12956: cast make differ rounding.
  - use rint() in some other val_int() methods as well.

  sql/item.h
    1.182 05/11/29 18:06:43 ramil@stripped +2 -2
    Addition to fix for bug #12956: cast make differ rounding.
    - use rint() in some other val_int() methods as well.

  sql/field.cc
    1.293 05/11/29 18:06:42 ramil@stripped +2 -2
    Addition to fix for bug #12956: cast make differ rounding.
    - use rint() in some other val_int() methods as well.

# 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:	ramil
# Host:	myoffice.izhnet.ru
# Root:	/usr/home/ram/work/5.0.b12956

--- 1.292/sql/field.cc	2005-11-22 02:30:09 +04:00
+++ 1.293/sql/field.cc	2005-11-29 18:06:42 +04:00
@@ -3953,7 +3953,7 @@ longlong Field_float::val_int(void)
   else
 #endif
     memcpy_fixed((byte*) &j,ptr,sizeof(j));
-  return ((longlong) j);
+  return (longlong) rint(j);
 }
 
 
@@ -4241,7 +4241,7 @@ longlong Field_double::val_int(void)
   else
 #endif
     doubleget(j,ptr);
-  return ((longlong) j);
+  return (longlong) rint(j);
 }
 
 

--- 1.181/sql/item.h	2005-11-21 23:15:41 +04:00
+++ 1.182/sql/item.h	2005-11-29 18:06:43 +04:00
@@ -159,7 +159,7 @@ struct Hybrid_type_traits
   { val->real/= ulonglong2double(u); }
 
   virtual longlong val_int(Hybrid_type *val, bool unsigned_flag) const
-  { return (longlong) val->real; }
+  { return (longlong) rint(val->real); }
   virtual double val_real(Hybrid_type *val) const { return val->real; }
   virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const;
   virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const;
@@ -1341,7 +1341,7 @@ public:
     {
       return LONGLONG_MAX;
     }
-    return (longlong) (value+(value > 0 ? 0.5 : -0.5));
+    return (longlong) rint(value);
   }
   String *val_str(String*);
   my_decimal *val_decimal(my_decimal *);
Thread
bk commit into 5.0 tree (ramil:1.1994) BUG#12956ramil29 Nov