mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-30 14:34:22 +01:00
Fix accumulator reset when arguments outnumber aggregates
Previously, while resetting accumulator registers, we would also reset subsequent registers. This happened because the number of registers to reset was computed as the sum of arguments rather than the number of aggregate functions.
This commit is contained in:
@@ -762,7 +762,7 @@ pub fn group_by_emit_row_phase<'a>(
|
||||
program.emit_insn(Insn::Null {
|
||||
dest: start_reg,
|
||||
dest_end: Some(
|
||||
start_reg + t_ctx.non_aggregate_expressions.len() + plan.agg_args_count() - 1,
|
||||
start_reg + t_ctx.non_aggregate_expressions.len() + plan.aggregates.len() - 1,
|
||||
),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user