List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:May 12 2011 12:58pm
Subject:bzr commit into mysql-trunk branch (alexander.barkov:3366) WL#946
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-trunk-wl946/ based on revid:alexander.barkov@stripped

 3366 Alexander Barkov	2011-05-12
      WL#946
      Fixing warnings: converting to 'long long int' from 'double'

    modified:
      sql/field.cc
=== modified file 'sql/field.cc'
--- a/sql/field.cc	2011-05-12 11:57:06 +0000
+++ b/sql/field.cc	2011-05-12 12:58:20 +0000
@@ -5052,7 +5052,7 @@ int Field_datetime_common::store(double 
   int warnings= 0;
   lldiv_t lld;
   lld.quot= (longlong) trunc(nr);
-  lld.rem= round((nr - (double) lld.quot) * 1000000000);
+  lld.rem= (longlong) double2ulonglong(round((nr - (double) lld.quot) * 1000000000));
   int error= Field_temporal::store_lldiv_t(&lld, &warnings);
   if (warnings)
     set_warnings(nr, warnings);
@@ -5578,7 +5578,7 @@ int Field_time_common::store(double nr)
   int warnings= 0;
   lldiv_t lld;
   lld.quot= (longlong) trunc(nr);
-  lld.rem= round((nr - (double) lld.quot) * 1000000000);
+  lld.rem= (longlong) double2ulonglong(round((nr - (double) lld.quot) * 1000000000));
   int error= Field_temporal::store_lldiv_t(&lld, &warnings);
   if (warnings)
     set_warnings(nr, warnings);


Attachment: [text/bzr-bundle] bzr/alexander.barkov@oracle.com-20110512125820-o7zrpa7k3s0lvsxk.bundle
Thread
bzr commit into mysql-trunk branch (alexander.barkov:3366) WL#946Alexander Barkov12 May