Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 11.4.12
-
Unexpected results
-
Q4/2026 Server Development
Description
The following scripts demonstrate this inconsistency, which might be unexpected
CREATE TABLE t (sh BIGINT UNSIGNED, g INT); |
INSERT INTO t VALUES (18446744073709551588, 1); -- 2^64 - 28 |
 |
SELECT MIN(sh) FROM t; -- 18446744073709551588 correct |
SELECT CAST(sh AS DOUBLE) FROM t; -- 1.8446744073709552e+19 correct (no aggregate) |
SELECT CAST(MIN(sh) AS DOUBLE) FROM t; -- -28.0 WRONG |
SELECT MIN(sh) + 0e0 FROM t; -- -28.0 WRONG (no CAST needed) |
SELECT SQRT(MIN(sh)) FROM t; -- NULL (expected 4294967296) WRONG |
Attachments
Issue Links
- is duplicated by
-
MDEV-41381 BIGINT UNSIGNED value >= 2^63 is returned by both IN (subquery) and NOT IN (subquery) against a DOUBLE column
-
- Closed
-
- relates to
-
MDEV-41486 Inconsistent result: "a.x <= b.y" is true in EXISTS but the equivalent JOIN returns no row (REAL vs BIGINT UNSIGNED, Range checked for each record)
-
- Confirmed
-