Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.60, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
CentOS Linux release 7.5.1804 (Core)
Linux 3.10.0-862.11.6.el7.x86_64
MariaDB Server 5.5.60-1.el7_5
Description
In regards to the attached database/table, the following query returns only 9 rows and skips values for some regions, unlike older versions of MySQL (such as 5.0.95 on CentOS 5 Linux):
SELECT region, NAME, population/area AS dichte FROM cia c WHERE
population/area = (SELECT MAX(population/area) FROM cia cc WHERE
c.region = cc.region);
This appears to be a result of precision issues with floating point values affecting value comparisons.
The following two queries which are equivalent give different result sets:
SELECT region, NAME, population/area FROM cia c WHERE population/area =
(SELECT MAX(population/area) FROM cia cc WHERE area<150000 AND c.region
= cc.region) AND AREA<150000;
SELECT region, NAME, population/area FROM cia c WHERE AREA<150000 AND
population/area = (SELECT MAX(population/area) FROM cia cc WHERE
area<150000 AND c.region = cc.region);
Attachments
Issue Links
- causes
-
MDEV-23702 calculating(auto rounding) issue
- Closed
-
MDEV-23762 Strange type-inference/rounding problem since >10.3.23
- Closed
- relates to
-
MDEV-23582 Unexpected result upon division of decimal values (comparing to other implementations)
- Closed