Repository navigation
SQLite: Bind <, <=, > and >= tighter than = - #2678
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 #2678 +/- ##
=======================================
Coverage 81.28% 81.29%
=======================================
Files 42 42
Lines 33920 33943 +23
Branches 33920 33943 +23
=======================================
+ Hits 27571 27593 +22
- Misses 2785 2786 +1
Partials 3564 3564 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
sqlite-comparison-precedence
branch
from
October 18, 2026 14:17
922069d to
ef09b11
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.
SQLite's operator table puts
<,<=,>and>=one level above=,==,<>,!=,IS,IN,LIKEandBETWEEN(https://www.sqlite.org/lang_expr.html#operators_and_parse_affecting_attributes). Soa = b < cmeansa = (b < c): SQLite 3.51.1 evaluatesSELECT 2 = 1 < 3to0, which only holds for2 = (1 < 3). The SQLite dialect used a single level for all comparisons and parsed it as(a = b) < c.SQLiteDialectnow returns a separate precedence for<,<=,>and>=. Since the default table has no free value between=and the bitwise operators, the dialect overridesprec_valuewith the default levels shifted up by one above=. Other dialects are unchanged: PostgreSQL 16 and DuckDB 1.4.4 reject2 = 1 < 3outright, so there is no grouping to match there. Tests check the tree for each pairing,INandBETWEENagainst<, and that every other dialect still parsesa = b < cas(a = b) < c.