List:MySQL and .NET« Previous MessageNext Message »
From:David Dindorp Date:October 28 2006 9:26pm
Subject:RE: New bugs category for Visual Studio plugin
View as plain text  
Reggie,

> Have a look at this link (if you have not already).
> 
> http://dev.mysql.com/doc/refman/5.1/en/problems-with-float.html

Thanks.  I've seen it before..

I don't think it's relevant (but feel free to correct me):

a) In the case we're discussing, the user does not have control over
   the query.  It's built for him.  (... And the query builder has no
   provision for setting a precision to use when comparing floats.  It
   could in theory do as the example you link to, but it doesn't..)

b) MySQL stores floating point numbers in one precision.  It compares
   numbers using this precision.  But it returns results with another
   (lower) precision.

   This issue would not need a workaround in each SELECT, if it was
   solved in the server so that numbers were either returned with a
   higher precision (enough to match the record later with a SELECT),
   or numbers were stored with a lower precision (in practice we'd be
   rounding numbers on INSERT rather than on SELECT).

   Solving the problem in the server would be consistent with what
   other professional database server products do, as far as I can see:

         INSERT:              0.666666666666667     0.6666666666666666
(MySQL)  SELECT *:            0.666666666666667     0.666666666666667
(MS SQL) SELECT *:            0.66666666666666696   0.66666666666666663
(MySQL)  WHERE:                   1 record               0 records
(MS SQL) WHERE:                   1 record               1 record

   (For the WHERE clauses I used the values I got from the server in
   the corresponding SELECT (on the same server type).  For data types
   on MS SQL, I used the conversion table from
http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/mysql.mspx
)

Ho hum..

Thread
New bugs category for Visual Studio pluginReggie Burnett25 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp26 Oct
  • Re: New bugs category for Visual Studio pluginMartin MC Brown26 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp26 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett26 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp26 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett26 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp27 Oct
  • Re: New bugs category for Visual Studio pluginBarry Zubel27 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett27 Oct
    • MySQL not taking a Double.MaxValueChris Herridge19 Feb
      • RE: MySQL not taking a Double.MaxValueJohan Steyn19 Feb
      • RE: MySQL not taking a Double.MaxValueReggie Burnett21 Feb
RE: New bugs category for Visual Studio pluginYvan Rodrigues27 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp27 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp28 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett29 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp9 Nov
  • RE: New bugs category for Visual Studio pluginReggie Burnett15 Nov
RE: MySQL not taking a Double.MaxValueChris Herridge19 Feb