Skip to main content

validate_selection_dependencies

Function validate_selection_dependencies 

Source
pub(crate) fn validate_selection_dependencies(
    catalog: &Catalog,
    depends_on: &BTreeSet<GlobalId>,
) -> Result<(), AdapterError>
Expand description

Checks that a read-then-write may read what its selection depends on.

An invalid selection is invalid wherever the statement runs, so a caller with something contextual to report, such as the transaction state, must ask this first. Reporting the transaction for a statement that can never work suggests it would work outside one.

catalog must be the snapshot the plan was built against. A missing item means the caller mixed snapshots, which is reported as a catalog error rather than treated as a dropped dependency.