mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-23702 calculating(auto rounding) issue
Implement a different fix for
"MDEV-19232: Floating point precision / value comparison problem"
Instead of truncating decimal values after every division,
truncate them for comparison purposes.
This reverts commit 62d73df6b2
but keeps the test.
This commit is contained in:
@ -2596,7 +2596,7 @@ SELECT
|
||||
population, area, population/area,
|
||||
cast(population/area as DECIMAL(20,9)) FROM t1 LIMIT 1;
|
||||
population area population/area cast(population/area as DECIMAL(20,9))
|
||||
11797 91 129.6374 129.637400000
|
||||
11797 91 129.6374 129.637362637
|
||||
SELECT * FROM t1 A
|
||||
WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region);
|
||||
region area population
|
||||
|
Reference in New Issue
Block a user