Bug #28979 | Floats/Doubles in scientific notation don't work in WHERE clauses | ||
---|---|---|---|
Submitted: | 8 Jun 2007 15:13 | Modified: | 20 Jun 2007 8:57 |
Reporter: | Craig Holmquist | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 5.0.44-BK, 5.0.41 | OS: | Windows |
Assigned to: | Igor Babaev | CPU Architecture: | Any |
[8 Jun 2007 15:13]
Craig Holmquist
[8 Jun 2007 16:21]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described with latest 5.0.44-BK on Linux. The problem is that 2 values in scientific notation behaves differently(!) in WHERE, but are represented as same in SELECT list. Comapre: mysql> SELECT *, 4.2016437530517578e+001 FROM testfl; +------------------+-------------------------+ | f | 4.2016437530517578e+001 | +------------------+-------------------------+ | 42.0164375305176 | 42.016437530518 | +------------------+-------------------------+ 1 row in set (0.01 sec) mysql> SELECT * FROM testfl WHERE f = 4.2016437530517578e+001; +------------------+ | f | +------------------+ | 42.0164375305176 | +------------------+ 1 row in set (0.01 sec) Here we have rounding, but row is selected. Here: mysql> SELECT * FROM testfl WHERE f = 4.20164375305175780e+001; Empty set (0.00 sec) mysql> SELECT *, 4.20164375305175780e+001 FROM testfl; +------------------+--------------------------+ | f | 4.20164375305175780e+001 | +------------------+--------------------------+ | 42.0164375305176 | 42.016437530518 | +------------------+--------------------------+ 1 row in set (0.00 sec) in SELECT list value is represednted as the same as before after rounding, but it is considered differently by WHERE. Thus, this is a bug.
[20 Jun 2007 8:57]
Sergei Golubchik
This is not a bug. See http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html