Files
turso/core
Pekka Enberg 86c97fca6d Merge 'Fix sum() to follow the SQLite semantics' from FamHaggs
### Follow SUM [spec](https://sqlite.org/lang_aggfunc.html)
This PR updates the `SUM` aggregation logic to follow the
[Kahan–Babushka–Neumaier summation
algorithm](https://en.wikipedia.org/wiki/Kahan_summation_algorithm),
consistent with SQLite’s implementation. It improves the numerical
stability of floating-point summation.This fixes issue #2252 . I added a
fuzz test to ensure the compatibility of the implementations
I also fixed the return types for `SUM` to match SQLite’s documented
behavior. This was previously discussed in
[#2182](https://github.com/tursodatabase/turso/pull/2182), but part of
the logic was later unintentionally overwritten by
[#2265](https://github.com/tursodatabase/turso/pull/2265).
I introduced two helper functions, `apply_kbn_step` and
`apply_kbn_step_int`, in `vbde/execute.rs` to handle floating-point and
integer accumulation respectively. However, I’m new to this codebase and
would welcome constructive feedback on whether there’s a better place
for these helpers.

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #2270
2025-07-27 09:08:34 +03:00
..
2025-07-16 14:02:56 +04:00
2025-07-14 11:20:49 +04:00
2025-07-17 21:43:07 +03:00
2025-06-23 19:52:13 +01:00
2025-06-30 10:01:03 +03:00
2025-07-10 19:15:39 +08:00
2025-01-28 14:55:38 -05:00
2025-07-18 07:28:36 +02:00
2025-07-23 16:58:22 -04:00
2025-06-23 19:52:13 +01:00
2025-07-24 19:19:48 -05:00
2025-01-28 14:55:38 -05:00
2025-07-26 19:37:39 -05:00
2025-06-23 19:52:13 +01:00
2024-12-24 18:04:30 +01:00
2025-07-23 16:58:22 -04:00
2025-06-30 09:54:13 +03:00