Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.11, 11.4, 11.8
-
Unexpected results
-
Change the "-0" results in many SELECT scenarios to just return "0".
Description
MariaDB [test]> SELECT @x := -'', @y := 0 - ''; |
+-----------+--------------+ |
| @x := -'' | @y := 0 - '' | |
+-----------+--------------+ |
| -0 | 0 |
|
+-----------+--------------+ |
1 row in set, 2 warnings (0.001 sec) |
|
|
Warning (Code 1292): Truncated incorrect DOUBLE value: '' |
Warning (Code 1292): Truncated incorrect DOUBLE value: '' |
|
|
MariaDB [test]> SELECT -0, -0.0, -(DATE '0000-00-00'), @x, -@x, --@x; |
+----+------+----------------------+------+------+------+ |
| -0 | -0.0 | -(DATE '0000-00-00') | @x | -@x | --@x | |
+----+------+----------------------+------+------+------+ |
| 0 | 0.0 | 0 | -0 | 0 | -0 |
|
+----+------+----------------------+------+------+------+ |
1 row in set (0.000 sec) |
I don't think that -0 is an intended result, and it seems to only occur in one specific case.
I'm reporting this bug mainly to document that this anomaly exists. Just in case it has consequences in some corner cases.
Attachments
Issue Links
- is duplicated by
-
MDEV-39350 Float value -0 gets replicated as 0 and hashes dont match
-
- Closed
-
- relates to
-
MDEV-39350 Float value -0 gets replicated as 0 and hashes dont match
-
- Closed
-