From 9c8dd7ebae4b2a4612cad8cf4db4ab64c32c605e Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Wed, 7 May 2025 15:50:08 -0400 Subject: [PATCH] Store current offset and value positions on program builder to remap bound parameters --- core/vdbe/builder.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/vdbe/builder.rs b/core/vdbe/builder.rs index de151d6be..a748f32b3 100644 --- a/core/vdbe/builder.rs +++ b/core/vdbe/builder.rs @@ -1,6 +1,7 @@ use std::{ cell::Cell, cmp::Ordering, + num::NonZero, rc::{Rc, Weak}, sync::Arc, }; @@ -38,7 +39,8 @@ pub struct ProgramBuilder { pub parameters: Parameters, pub result_columns: Vec, pub table_references: Vec, - // Index of the referenced insert value to maintain ordering of paramaterized values + // Indexes of the referenced insert values to maintain ordering of paramaters + pub param_positions: Option)>>, pub current_col_idx: Option, } @@ -97,6 +99,7 @@ impl ProgramBuilder { parameters: Parameters::new(), result_columns: Vec::new(), table_references: Vec::new(), + param_positions: None, current_col_idx: None, } } @@ -110,6 +113,12 @@ impl ProgramBuilder { span } + pub fn set_param_remap(&mut self, remap: Option>>) { + if let Some(remap) = remap { + self.parameters.set_remap(remap); + } + } + /// End the current constant span. The last instruction that was emitted is the last /// instruction in the span. pub fn constant_span_end(&mut self, span_idx: usize) {