pub fn plan_mutates_store(plan: &LogicalPlan) -> boolExpand description
The statement’s one write-attempt fact (ADR-0402 Decision 2): the plan
walk over [call_writes_store]’s effect question and the planner’s
clause table — the READ access-mode gate’s (ADR-0742) key, exported
from the exec module that owns it.
Whether plan holds a mutation operator — the statement’s ADR-0402
Decision 2 write-attempt fact, recorded once at statement entry (before
any rows flow) through the canonical plan walk
(relate_planner::plan_any_clause over walk_plan_clauses): every
part, every NEXT stage, and every nested body the walk descends into
(CALL { … }, WHEN/ELSE, FOREACH bodies, expression subqueries). A
write inside a body that never dispatches — an empty driving row set, an
untaken branch — is therefore still an attempt, which is the same
short-circuit the empty top-level pipeline is made of. Both statement
boundaries that name an effect record it here — the write path and the
read admission — so the fact has one source on every route. The READ
access-mode gate (ADR-0742, relate::gate) asks the same question, so
it is exported from this module, the one that owns mutates_store —
the clause-level callback the walk applies.
The planner’s clause_mutates_store answers each clause; the two shapes
whose answer lives at this layer are decided by [mutates_store], which
this walk applies clause by clause.