Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.3.12, 5.5.37, 10.0.11
-
None
-
None
Description
Two decimal literals:
0.1111111111222222222233333333334444444444
and
0.111111111122222222223333333333
are considered as non-equal by "=",
but considered as equal for UNION DISTINCT:
MariaDB [test]> SELECT 0.1111111111222222222233333333334444444444 = 0.111111111122222222223333333333 AS cmp;
|
+-----+
|
| cmp |
|
+-----+
|
| 0 |
|
+-----+
|
1 row in set (0.00 sec)
|
 |
MariaDB [test]> SELECT 0.1111111111222222222233333333334444444444 AS a UNION SELECT 0.111111111122222222223333333333;
|
+----------------------------------+
|
| a |
|
+----------------------------------+
|
| 0.111111111122222222223333333333 |
|
+----------------------------------+
|
1 row in set (0.01 sec)
|
Comparison in "=" and comparison in UNION DISTINCT should use the same rules.
The problem most likely happens because we don't support fields with decimal
scale > 30. UNION uses a temporary table and creates a field,
while '=' does not need a field and compares the two numbers directly.
Literals should probably be fixed not to support more than 30 fractional as well.
Attachments
Issue Links
- is part of
-
MDEV-10138 Support for decimals up to 38 digits
- Closed