Skip to content
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

sql: disambiguate ANY/ALL/SOME exprs in formatting #19569

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

jordanlewis
Copy link
Member

Previously, ANY/ALL/SOME expressions would be formatted without
parentheses around their antecedents. This could lead to invalid input.
For example, the following query doesn't parse properly since the type
annotation binds to the comparison expression, not the array:

SELECT 1 = ANY ARRAY[1]:::INT[]

This patch adds the disambiguating enclosing parenthesis.

Fixes the roundtrip problems mentioned in #19555.

Previously, ANY/ALL/SOME expressions would be formatted without
parentheses around their antecedents. This could lead to invalid input.
For example, the following query doesn't parse properly since the type
annotation binds to the comparison expression, not the array:

```
SELECT 1 = ANY ARRAY[1]:::INT[]
```

This patch adds the disambiguating enclosing parenthesis.
@jordanlewis jordanlewis requested review from justinj, nvanbenschoten and a team October 26, 2017 17:46
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis
Copy link
Member Author

Split from #19424

@nvanbenschoten
Copy link
Member

:lgtm:


Review status: 0 of 5 files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@jordanlewis
Copy link
Member Author

TFTR

@jordanlewis jordanlewis merged commit 5a6b431 into cockroachdb:master Oct 26, 2017
@jordanlewis jordanlewis deleted the anyallsome-fmt branch October 26, 2017 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants