Fix update queries when limit is 0

This commit is contained in:
PThorpe92
2025-03-26 15:26:50 -04:00
parent a88ce2a4b7
commit ff02d74afb

View File

@@ -423,6 +423,13 @@ fn emit_program_for_update(
plan.returning.as_ref().map_or(0, |r| r.len()),
)?;
// Exit on LIMIT 0
if let Some(0) = plan.limit {
epilogue(program, init_label, start_offset, false)?;
program.result_columns = plan.returning.unwrap_or_default();
program.table_references = plan.table_references;
return Ok(());
}
let after_main_loop_label = program.allocate_label();
t_ctx.label_main_loop_end = Some(after_main_loop_label);
if plan.contains_constant_false_condition {