Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
This script:
SELECT CAST(-7378697629483820647 AS UNSIGNED); |
returns
+----------------------------------------+
|
| CAST(-7378697629483820647 AS UNSIGNED) |
|
+----------------------------------------+
|
| 11068046444225730969 |
|
+----------------------------------------+
|
1 row in set, 1 warning (0.00 sec)
|
with a warning:
+-------+------+-------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+-------------------------------------------------------------------------+
|
| Note | 1105 | Cast to unsigned converted negative integer to it's positive complement |
|
+-------+------+-------------------------------------------------------------------------+
|
If I now do the other way around:
SELECT CAST(11068046444225730969 AS SIGNED); |
it returns this result:
+--------------------------------------+
|
| CAST(11068046444225730969 AS SIGNED) |
|
+--------------------------------------+
|
| -7378697629483820647 |
|
+--------------------------------------+
|
1 row in set (0.00 sec)
|
but no warning is issued.
Expect to get a warning Cast to signed converted positive integer to it's negative complement