Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Trivial
-
Resolution: Unresolved
-
10.11, 11.4, 11.8
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.