New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!(gravsearch): Handle UNION scopes with FILTER correctly (DSP-1240) #1790
Conversation
- Add links to Gravsearch article.
@loicjaouen This may affect you; the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks.
|
||
### FILTER in UNION | ||
|
||
A `FILTER` in a `UNION` block can only use variables that are bound in the same block, otherwise the query will be rejected. This query is invalid because `?text` is not bound in the `UNION` block containing the `FILTER` where the variable is used: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh, even I did not know that. Thanks for the examples.
Thanks for reviewing! |
resolves DSP-1240
UNION
scopes separately for generated variables.UNION
block, don't allow aFILTER
that refers to a variable that hasn't been bound in the same block.ORDER BY
, require it to be bound at the top level of theWHERE
clause.Breaking Changes
FILTER in UNION
A
FILTER
in aUNION
block can only use variables that are bound in the same block, otherwise the query will be rejected. This query is invalid because?text
is not bound in theUNION
block containing theFILTER
where the variable is used:It can be corrected like this:
ORDER BY
A variable used in
ORDER BY
must be bound at the top level of theWHERE
clause. This query is invalid, because?int
is not bound at the top level of theWHERE
clause:It can be corrected like this: