Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5
-
None
Description
DOUBLE columns accept hex hybrids only in the range 0x0000000000000000..x7FFFFFFFFFFFFFFF without problems:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a DOUBLE); |
INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF); |
SELECT * FROM t1; |
+----------------------+
|
| a |
|
+----------------------+
|
| 9.223372036854776e18 |
|
+----------------------+
|
Looks good so far.
Now let's try a larger value:
INSERT INTO t1 VALUES (0x8000000000000000); |
ERROR 1264 (22003): Out of range value for column 'a' at row 1
|
Looks wrong. There should not be an error.
The same problem happens with all values in the range 0x8000000000000000..0xFFFFFFFFFFFFFFFF.
Note, an explicit CAST correctly handles these values:
SELECT
|
CAST(0x8000000000000000 AS DOUBLE), |
CAST(0xFFFFFFFFFFFFFFFF AS DOUBLE); |
+------------------------------------+------------------------------------+
|
| CAST(0x8000000000000000 AS DOUBLE) | CAST(0xFFFFFFFFFFFFFFFF AS DOUBLE) |
|
+------------------------------------+------------------------------------+
|
| 9.223372036854776e18 | 1.8446744073709552e19 |
|
+------------------------------------+------------------------------------+
|