You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1] [bug] BIGINT UNSIGNED > 2^53 silently corrupts via JS Number #410
[P1] [bug] BIGINT UNSIGNED > 2^53 silently corrupts via JS Number deserialization
Context
Rust SqlValue::UInt(u64) for BIGINT UNSIGNED deserializes through serde(untagged) to a JS number. JS Number is a 64-bit double; integers above Number.MAX_SAFE_INTEGER (2^53 - 1) lose precision.
Problem
Per docs/audits/results.md F17.
A users.id BIGINT UNSIGNED AUTO_INCREMENT past 2^53 (rare but possible on long-lived systems) shows the same number for two distinct IDs. Sorting breaks; UPDATE WHERE matches the wrong row; COUNT(*) is wrong. Same risk applies to signed BIGINT near 2^63.
SELECT * FROM ids WHERE id = 9007199254740993 shows the exact value. Sorting crosses the 2^53 boundary correctly.
Proposed fix
Scope M. (a) Rust serializes Int(i64)/UInt(u64) as strings when above 2^53; TS SqlValue adds a bigint or string variant for large integers. OR (b) Use a tagged-enum on the wire (#[serde(tag = "type")]).
Acceptance
Values above 2^53 render exactly; sorting is monotonic.
Activity
EVWorth commentedon Aug 30, 2026
Fixed by the BIGINT work in #502/#510.
executor.rsnow carries both signed and unsigned 64-bit integers as text so JSON.parse cannot truncate them:The frontend uses ColumnMeta to know the value is still numeric.