no-mistakes-postgres-engine 0.109.131

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::{ScopeVisitor, Snapshot};

pub(super) fn select(visitor: &mut ScopeVisitor<'_>, selected: &Snapshot, other: &Snapshot) {
    visitor.restore_variants(selected);
    for (index, scope) in visitor.scopes.iter_mut().enumerate() {
        for (name, state) in scope {
            let selected = selected.get(index).and_then(|scope| scope.get(name));
            let other = other.get(index).and_then(|scope| scope.get(name));
            if selected != other {
                if let Some(values) = &mut state.variants {
                    for value in values {
                        value.enumerated = true;
                    }
                }
            }
        }
    }
}