mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-17 23:24:19 +01:00
This PR has two parts: 1. The first commit refactors how information about which registers should be populated in the aggregation loop is calculated and propagated. This simplification revealed a bug, which is addressed as part of the same commit (see the included test). 2. The second commit fixes incorrect behavior for queries where complex expressions include both aggregate and non-aggregate components. For example, the following query previously produced incorrect results: ```sql SELECT CASE WHEN c0 != 'x' THEN group_concat(c1, ',') ELSE 'x' END FROM t0 GROUP BY c0; ``` In such cases, non-aggregate columns like `c0` were not available during the result construction for each group, leading to incorrect evaluation. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #1780