Repository navigation
SQLite: Parse the BETWEEN lower bound up to its AND - #2664
Open
LucaCappelletti94 wants to merge 2 commits into
Open
LucaCappelletti94 wants to merge 2 commits into
LucaCappelletti94 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2664 +/- ##
=======================================
Coverage 81.52% 81.53%
=======================================
Files 42 42
Lines 34205 34211 +6
Branches 34205 34211 +6
=======================================
+ Hits 27885 27893 +8
Misses 2770 2770
+ Partials 3550 3548 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
added this pull request to stack #2666
October 17, 2026 16:57
LucaCappelletti94
force-pushed
the
sqlite-between-operand-precedence
branch
3 times, most recently
from
October 20, 2026 12:28
d66e8e3 to
9f9b65e
Compare
LucaCappelletti94
force-pushed
the
sqlite-between-operand-precedence
branch
from
October 21, 2026 07:31
9f9b65e to
46f4566
Compare
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.
In SQLite, comparison operators,
IS,LIKE,NOTNULLandBETWEENshare one precedence level (https://www.sqlite.org/lang_expr.html#operators_and_parse_affecting_attributes), so the lower bound of aBETWEENextends up to theAND: SQLite 3.51.1 runs2 BETWEEN 1 > 0 AND 3,2 BETWEEN NULL IS NULL AND 3,2 BETWEEN 'a' LIKE 'a' AND 3and a nestedBETWEENas the lower bound. The SQLite dialect stopped the lower bound at theBETWEENprecedence and failed withExpected: AND, found: >.A new dialect method,
between_low_bound_precedence, defaults to theBETWEENprecedence, andSQLiteDialectreturns theANDprecedence instead. The upper bound is unchanged, so operators after it still apply to the wholeBETWEEN. Tests check the parsed lower bound and these forms in SQLite, and the unchanged error in the generic dialect.