Skip to content

SQLite: Bind prefix operators tighter than COLLATE - #3076

Open
LucaCappelletti94 wants to merge 1 commit into
upstream/stacked-collatefrom
upstream/unary-collate-precedence
Open

LucaCappelletti94 wants to merge 1 commit into
upstream/stacked-collatefrom
upstream/unary-collate-precedence

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

SELECT -(-1) COLLATE BINARY in the SQLite dialect parses as -((-1) COLLATE BINARY), and +x COLLATE NOCASE and ~x COLLATE NOCASE also put the collation under the operator, while SQLite reads (-(-1)) COLLATE BINARY.

This PR maps the UnaryPlusMinus level from #2829 to just above Collate in the SQLite dialect, and adds a Precedence::UnaryBitwiseNot level for the operand of ~, which keeps its current bound in every other dialect.

SQLite ~ 1 * 2 now groups as (~1) * 2, as in SQLite. In PostgreSQL ~ is a generic prefix operator that groups inside COLLATE.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.62%. Comparing base (398474b) to head (d7e831c).

Files with missing lines Patch % Lines
src/parser/mod.rs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           upstream/stacked-collate    #3076   +/-   ##
=========================================================
  Coverage                     83.62%   83.62%           
=========================================================
  Files                            42       42           
  Lines                         35772    35774    +2     
  Branches                      35772    35774    +2     
=========================================================
+ Hits                          29913    29915    +2     
  Misses                         2418     2418           
  Partials                       3441     3441           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change bug Something isn't working SQLite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants