From c2fe13ad4f0dc2ff80d32cf51127b06894d9865f Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Tue, 14 Oct 2025 12:18:53 +0300 Subject: [PATCH] Update documentation of UpdatePlan::ephemeral_plan It now better reflects when it is used. --- core/translate/plan.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/translate/plan.rs b/core/translate/plan.rs index 98cd8e2e2..d197cb443 100644 --- a/core/translate/plan.rs +++ b/core/translate/plan.rs @@ -440,7 +440,10 @@ pub struct UpdatePlan { // whether the WHERE clause is always false pub contains_constant_false_condition: bool, pub indexes_to_update: Vec>, - // If the table's rowid alias is used, gather all the target rowids into an ephemeral table, and then use that table as the single JoinedTable for the actual UPDATE loop. + // If the UPDATE modifies any column that is present in the key of the btree used to iterate over the table (either the table itself or an index), + // gather all the target rowids into an ephemeral table, and then use that table as the single JoinedTable for the actual UPDATE loop. + // This ensures the keys of the btree used to iterate cannot be changed during the UPDATE loop itself, ensuring all the intended rows actually get + // updated and none are skipped. pub ephemeral_plan: Option, // For ALTER TABLE turso-db emits appropriate DDL statement in the "updates" cell of CDC table // This field is present only for update plan created for ALTER TABLE when CDC mode has "updates" values