Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 11.4.12
-
mariadb 11.4.12-MariaDB-ubu2404
-
Unexpected results
Description
I noticed that VAR_SAMP (and VAR_POP / STDDEV_SAMP) functions over BIGINT UNSIGNED values near 2^64 is insertion-order dependent, making the results non-deterministic. This might be unexpected
CREATE TABLE t (sh BIGINT UNSIGNED); |
INSERT INTO t VALUES (18446744073709551588), (18446744073709549824); |
SELECT VAR_SAMP(sh) FROM t; -- 4194304.0 |
 |
CREATE TABLE t (sh BIGINT UNSIGNED); |
INSERT INTO t VALUES (18446744073709549824), (18446744073709551588); |
SELECT VAR_SAMP(sh) FROM t; -- 0.0 |