Bug #8435 | Precision math: BIGINT arithmetic isn't always correct | ||
---|---|---|---|
Submitted: | 11 Feb 2005 3:31 | Modified: | 8 Jun 2005 10:18 |
Reporter: | Trudy Pelzer | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.3-alpha-debug | OS: | Linux (SuSE 9.1) |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[11 Feb 2005 3:31]
Trudy Pelzer
[11 Feb 2005 3:42]
Trudy Pelzer
Sorry: I was in error when I was providing the expected results of the division operation. The correct results should,of course, be BIGINT values. For: mysql> select col1/2 from t1; +---------------------------+ | col1/2 | +---------------------------+ | 4500000000000000000.00000 | | 4500000000000000000.00000 | | 4500000000000000000.00000 | | 4500000000000000000.00000 | +---------------------------+ 6 rows in set (0.00 sec) -- The last 3 results are incorrect. The result should be: +------------------------+ | col1/2 | +------------------------+ | 4500000000000000000 | | 4500000000000000003 | | 4500000000000000028 | | 4500000000000000278 | +------------------------+ And for: mysql> select * from t1; +---------------------+ | col1 | +---------------------+ | 4500000000000000000 | | 4500000000000000000 | | 4500000000000000000 | | 4500000000000000000 | +---------------------+ 6 rows in set (0.00 sec) -- Same problem here, after the UPDATE. The correct result should be: +------------------------+ | col1/2 | ------------------------+ | 4500000000000000000 | | 4500000000000000003 | | 4500000000000000028 | | 4500000000000000278 | +------------------------+