List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:December 1 2007 9:46am
Subject:bk commit into 5.0 tree (kaa:1.2528)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kaa. When kaa 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-12-01 12:46:25+03:00, kaa@polly.(none) +1 -0
  Fixed the build failure on Windows. It does not have trunc() defined in math.h, so we should not use it code.

  sql/field.cc@stripped, 2007-12-01 12:46:22+03:00, kaa@polly.(none) +2 -1
    Fixed the build failure on Windows. It does not have trunc() defined in math.h, so we should not use it code.

diff -Nrup a/sql/field.cc b/sql/field.cc
--- a/sql/field.cc	2007-12-01 10:05:54 +03:00
+++ b/sql/field.cc	2007-12-01 12:46:22 +03:00
@@ -5909,6 +5909,7 @@ int Field_str::store(double nr)
   uint length;
   uint local_char_length= field_length / charset()->mbmaxlen;
   double anr= fabs(nr);
+  bool fractional= (anr != floor(anr));
   int neg= (nr < 0.0) ? 1 : 0;
   uint max_length;
   int exp;
@@ -5937,7 +5938,7 @@ int Field_str::store(double nr)
     calculate the maximum number of significant digits if the 'f'-format
     would be used (+1 for decimal point if the number has a fractional part).
   */
-  digits= max(0, (int) max_length - (nr != trunc(nr)));
+  digits= max(0, (int) max_length - fractional);
   /*
     If the exponent is negative, decrease digits by the number of leading zeros
     after the decimal point that do not count as significant digits.
Thread
bk commit into 5.0 tree (kaa:1.2528)Alexey Kopytov1 Dec