From 81c2f2eca6ebcb024d7c024802ce5a079de83772 Mon Sep 17 00:00:00 2001 From: jussisaurio Date: Thu, 1 Aug 2024 17:40:39 +0300 Subject: [PATCH] Add comment --- core/translate/where_clause.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/translate/where_clause.rs b/core/translate/where_clause.rs index d2ca0bba8..202b37adb 100644 --- a/core/translate/where_clause.rs +++ b/core/translate/where_clause.rs @@ -277,6 +277,11 @@ pub fn translate_processed_where<'a>( // and end up with a result where u.id = 3 and p.id = 5, which is incorrect. // Instead we replace the second SeekRowid with a comparison against the row that was already fetched, // i.e. we compare p.id == 5, which would not match (and is the correct result). + // + // It would probably be better to modify the AST in the WhereTerms directly, but that would require + // refactoring to not use &'a Ast::Expr references in the WhereTerms, i.e. the WhereClause would own its data + // and could mutate it to change the query as needed. We probably need to do this anyway if we want to have some + // kind of Query Plan construct that is not just a container for AST nodes. let rowid_reg = program.alloc_register(); program.emit_insn(Insn::RowId { cursor_id,