Bug #4077 | mysql: deletion of records buggy? | ||
---|---|---|---|
Submitted: | 9 Jun 2004 13:37 | Modified: | 29 Jul 2004 0:42 |
Reporter: | Bauke Jan Douma | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQLCC | Severity: | S2 (Serious) |
Version: | mysql-4.0.20 custom compile | OS: | Linux (Linux-2.6) |
Assigned to: | Jorge del Conde | CPU Architecture: | Any |
[9 Jun 2004 13:37]
Bauke Jan Douma
[10 Jun 2004 0:40]
Dean Ellis
This is due to problems with floating point comparisons (4 of your rows do not match the deletion criteria so they are not deleted). You can read more about problems with floating point here: http://dev.mysql.com/doc/mysql/en/Problems_with_float.html You would likely prefer using DOUBLE or NUMERIC for this, and doing away with the ABS(amount-?) comparison.
[10 Jun 2004 9:33]
Sergei Golubchik
Ok, the problem is that MySQL CC choses too small value of epsilon in the ABS(column-value)<epsilon e.g. for one of the undeleted rows: mysql> select amount,ABS(amount-245.34),format(amount,30) from xxx where checknum=2; +--------+---------------------+------------------------------------+ | amount | ABS(amount-245.34) | format(amount,30) | +--------+---------------------+------------------------------------+ | 245.34 | 3.6621093784106e-06 | 245.339996337890625000000000000000 | +--------+---------------------+------------------------------------+ 1 row in set (0.00 sec) (with format() you can print the real value of the column, without auto-magical rounding that printf("%f") does internally to pretend the value is what you want it to be) So in this case it should be at least ABS(amount-245.34)<4e-6 or amount=245.339996337890625 I'm recategorizing the report as MySQL CC bug
[29 Jul 2004 0:42]
Jorge del Conde
MySQLCC is not supported anymore and bugs in this software won't be fixed anymore.