Repository navigation
SQLite: Parse the BETWEEN lower bound up to its AND - #2664
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2664 +/- ##
=======================================
Coverage 81.29% 81.30%
=======================================
Files 42 42
Lines 33950 33956 +6
Branches 33950 33956 +6
=======================================
+ Hits 27601 27608 +7
Misses 2785 2785
+ Partials 3564 3563 -1 ☔ 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
from
October 18, 2026 14:24
1dbf078 to
f8c4284
Compare
LucaCappelletti94
force-pushed
the
sqlite-between-operand-precedence
branch
from
October 18, 2026 14:39
f8c4284 to
8f2538b
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.