Bug #30953 | suspicious results from LOG(B,X) functions | ||
---|---|---|---|
Submitted: | 11 Sep 2007 13:05 | Modified: | 29 Oct 2007 12:10 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 6.0.2-alpha, 5.0.48 | OS: | Windows (XP 64-bit) |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
Tags: | log() |
[11 Sep 2007 13:05]
Shane Bester
[11 Sep 2007 13:12]
MySQL Verification Team
On suse 9.3 the correct results are returned. Seems to only be a problem on windows for some reason. sql server however, returns correct results.
[12 Oct 2007 14:37]
Konstantin Osipov
Bad data.
[15 Oct 2007 12:38]
Sergei Golubchik
Shane, please try select format(log(col1,col1), 30) from t1; to see whether values are really identical, or just close enough and printf() rounds them both to the same value.
[15 Oct 2007 12:44]
MySQL Verification Team
5.0.48: mysql> select format(log(col1,col1), 30) from t1; +----------------------------------+ | format(log(col1,col1), 30) | +----------------------------------+ | 1.000000000000000000000000000000 | | 1.000000000000000000000000000000 | +----------------------------------+ 2 rows in set (0.00 sec)
[29 Oct 2007 12:10]
Alexey Botchkov
I tested it on my 32bit Windows, got the 'proper' behaviour. So it seems that the result here depends on the OS/processor. Unfortunately there's not much we can do about that in 5.0, besides setting the rule like 'Do not expect exact comparisons with DOUBLE types to work predictable'. I'd recommend CAST DECIMAL or ROUND() functions as workaround.