Repository navigation
Conversation
`WHERE u1.id IN ('a', 'b')`, `NOT IN`, `BETWEEN` and `LIKE` matched zero
rows on a single-table query. The planner strips the table's own
qualifier before it builds a filter, but the walk read only comparisons,
`AND`, `OR`, `NOT`, parentheses and `IS NULL`. Any other shape kept the
qualified name as a field name, which no stored document has. The check
that refuses a qualifier naming another table had the same gap, so
`wrong.id IN (...)` also matched nothing instead of failing.
Both walks now visit every expression shape, including function
arguments, `CASE` and `CAST`. A subquery body keeps its own qualifiers.
UPDATE (no FROM) and DELETE never ran the WHERE through the qualifier-stripping walk SELECT, UPDATE ... FROM and MERGE all share. WHERE orders.status = 1 built a filter keyed literally 'orders.status', which no stored document has -- a WHERE this shape silently matched no row, so the statement touched nothing, with no error. Both now compute the valid qualifier the same way UPDATE ... FROM's target_ref already does: the alias once the table is aliased, else the table's own name, then strip it through strip_and_convert_filters before building filters. A qualifier naming neither is refused as a typed error, not a silent no-op, matching every other statement kind.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHERE u1.id IN ('a', 'b'),NOT IN,BETWEENandLIKEmatched zero rows on a single-table query. The planner strips the table's own qualifier before it builds a filter, but the walk read only comparisons,AND,OR,NOT, parentheses andIS NULL. Any other shape kept the qualified name as a field name, which no stored document has. The check that refuses a qualifier naming another table had the same gap, sowrong.id IN (...)also matched nothing instead of failing.Both walks now visit every expression shape, including function arguments,
CASEandCAST. A subquery body keeps its own qualifiers.