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

Parse LIKE patterns as Expr not Value #579

Merged
merged 1 commit into from Aug 18, 2022

Conversation

andygrove
Copy link
Collaborator

@andygrove andygrove commented Aug 17, 2022

Closes #578

This fixes a regression in parsing LIKE patterns that was introduced in #569.

I also made some small improvements in the precedence code by extracting more hard-coded values into consts so we can more easily see the relationship between different operators. I added a link to the Postgres precedence docs for reference as well.

@andygrove andygrove requested a review from alamb August 17, 2022 18:27
@andygrove
Copy link
Collaborator Author

@ayushdg could you take a look?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2877509204

  • 42 of 44 (95.45%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 85.448%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tests/sqlparser_common.rs 29 31 93.55%
Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.28%
Totals Coverage Status
Change from base Build 2877505870: 0.01%
Covered Lines: 9530
Relevant Lines: 11153

💛 - Coveralls

Copy link
Contributor

@ayushdg ayushdg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the regressions and updating like patterns to accept expr's

@andygrove
Copy link
Collaborator Author

I'm going to go ahead and merge this based on the approval from @ayushdg since this is blocking a number of issues in DataFusion.

@andygrove andygrove merged commit eb7f1b0 into sqlparser-rs:main Aug 18, 2022
@andygrove andygrove deleted the like-pattern-expr branch August 18, 2022 16:02
@alamb
Copy link
Collaborator

alamb commented Aug 18, 2022

Thanks @andygrove

MazterQyou pushed a commit to cube-js/sqlparser-rs that referenced this pull request Dec 1, 2022
MazterQyou pushed a commit to cube-js/sqlparser-rs that referenced this pull request Dec 1, 2022
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.

Regression in parsing NULL LIKE <expr>
4 participants