mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-06 08:44:23 +01:00
rename
This commit is contained in:
@@ -67,13 +67,13 @@ pub fn handle_distinct(program: &mut ProgramBuilder, agg: &Aggregate, agg_arg_re
|
||||
let Distinctness::Distinct { ctx } = &agg.distinctness else {
|
||||
return;
|
||||
};
|
||||
let distinct_agg_ctx = ctx
|
||||
let distinct_ctx = ctx
|
||||
.as_ref()
|
||||
.expect("distinct aggregate context not populated");
|
||||
let num_regs = 1;
|
||||
program.emit_insn(Insn::Found {
|
||||
cursor_id: distinct_agg_ctx.cursor_id,
|
||||
target_pc: distinct_agg_ctx.label_on_conflict,
|
||||
cursor_id: distinct_ctx.cursor_id,
|
||||
target_pc: distinct_ctx.label_on_conflict,
|
||||
record_reg: agg_arg_reg,
|
||||
num_regs,
|
||||
});
|
||||
@@ -82,10 +82,10 @@ pub fn handle_distinct(program: &mut ProgramBuilder, agg: &Aggregate, agg_arg_re
|
||||
start_reg: agg_arg_reg,
|
||||
count: num_regs,
|
||||
dest_reg: record_reg,
|
||||
index_name: Some(distinct_agg_ctx.ephemeral_index_name.to_string()),
|
||||
index_name: Some(distinct_ctx.ephemeral_index_name.to_string()),
|
||||
});
|
||||
program.emit_insn(Insn::IdxInsert {
|
||||
cursor_id: distinct_agg_ctx.cursor_id,
|
||||
cursor_id: distinct_ctx.cursor_id,
|
||||
record_reg: record_reg,
|
||||
unpacked_start: None,
|
||||
unpacked_count: None,
|
||||
|
||||
@@ -775,8 +775,8 @@ pub fn group_by_emit_row_phase<'a>(
|
||||
);
|
||||
// SELECT DISTINCT also jumps here if there is a duplicate.
|
||||
if let Distinctness::Distinct { ctx } = &plan.distinctness {
|
||||
let distinct_agg_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
program.resolve_label(distinct_agg_ctx.label_on_conflict, program.offset());
|
||||
let distinct_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
program.resolve_label(distinct_ctx.label_on_conflict, program.offset());
|
||||
}
|
||||
program.emit_insn(Insn::Return {
|
||||
return_reg: registers.reg_subrtn_acc_output_return_offset,
|
||||
|
||||
@@ -791,8 +791,8 @@ fn emit_loop_source<'a>(
|
||||
)?;
|
||||
|
||||
if let Distinctness::Distinct { ctx } = &plan.distinctness {
|
||||
let distinct_agg_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
program.preassign_label_to_next_insn(distinct_agg_ctx.label_on_conflict);
|
||||
let distinct_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
program.preassign_label_to_next_insn(distinct_ctx.label_on_conflict);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -887,8 +887,8 @@ fn emit_loop_source<'a>(
|
||||
)?;
|
||||
|
||||
if let Distinctness::Distinct { ctx } = &plan.distinctness {
|
||||
let distinct_agg_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
program.preassign_label_to_next_insn(distinct_agg_ctx.label_on_conflict);
|
||||
let distinct_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
program.preassign_label_to_next_insn(distinct_ctx.label_on_conflict);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -252,9 +252,9 @@ pub fn order_by_sorter_insert(
|
||||
|
||||
// Handle SELECT DISTINCT deduplication
|
||||
if let Distinctness::Distinct { ctx } = &plan.distinctness {
|
||||
let distinct_agg_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
let distinct_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
let num_regs = order_by_len + translated_result_col_count;
|
||||
distinct_agg_ctx.emit_deduplication_insns(program, num_regs, start_reg);
|
||||
distinct_ctx.emit_deduplication_insns(program, num_regs, start_reg);
|
||||
}
|
||||
|
||||
let SortMetadata {
|
||||
|
||||
@@ -52,9 +52,9 @@ pub fn emit_select_result(
|
||||
|
||||
// Handle SELECT DISTINCT deduplication
|
||||
if let Distinctness::Distinct { ctx } = &plan.distinctness {
|
||||
let distinct_agg_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
let distinct_ctx = ctx.as_ref().expect("distinct context must exist");
|
||||
let num_regs = plan.result_columns.len();
|
||||
distinct_agg_ctx.emit_deduplication_insns(program, num_regs, start_reg);
|
||||
distinct_ctx.emit_deduplication_insns(program, num_regs, start_reg);
|
||||
}
|
||||
|
||||
emit_result_row_and_limit(
|
||||
|
||||
Reference in New Issue
Block a user