List:General Discussion« Previous MessageNext Message »
From:Michael R. Gile Date:April 18 1999 1:44pm
Subject:Re: Serious sum() bug in MySQL 3.22.21
View as plain text  
>Hi!
>
>This is probably a bug in the FreeBSD math library.

as you can see, monty doesn't like freebsd (and is very quick to blame it)

however, i get the same (-0.00) result on the following systems
yes, i know they are not the most recent version, but should at least indicate that it
isn't just a "freebsd" bug

freebsd 2.2.7 Mysql 3.22.14b-gamma
RedHat Linux 5.2 Mysql 3.22.10-beta
solaris 2.5 Mysql 3.21.33b

(note that the `dc' application produces 0 in all cases, not -0.00)

>Note that its common practice in most languages to NEVER compare a
>floating point value that may have fractions with '=', but instead
>always use:
>
>total between -0.5 and 0.5

this is good advice. why do you not use it in Mysql (i take it this is the question you
answer next)?

>Note that in MySQL 3.23 you will have not fixed point float fields, so
>in this case the sum above will be a very small value <> 0
>
>I think that if I change the '=' compare in MySQL to be 'smarter' it
>will brake more applications than it will fix :(

don't you think that *NOT* having fixed point float fields will break more applications
than it will fix?  it is my understanding that all many SQL applications depend on the
fact that the values are fixed point.

>Regards,
>Monty

======================================================
Michael Gile                             gilem@stripped
President                                (518)435-0682
Web Services Group                 http://www.wsg.net/
Thread
Serious sum() bug in MySQL 3.22.21tcobb18 Apr
  • Re: Serious sum() bug in MySQL 3.22.21Mike Machado18 Apr
  • Serious sum() bug in MySQL 3.22.21Michael Widenius18 Apr
    • Re: Serious sum() bug in MySQL 3.22.21Michael R. Gile18 Apr
      • Re: Serious sum() bug in MySQL 3.22.21Michael Widenius19 Apr
        • Re: Serious sum() bug in MySQL 3.22.21Michael R. Gile19 Apr
  • Re: Serious sum() bug in MySQL 3.22.21Barry18 Apr
  • Re: Seriously Disruptive DBA Jonathan G. Lampe24 Aug
    • Re: Seriously Disruptive DBAMark Schoonover24 Aug