Skip to content

SQLite: Parse IS NULL against + as a comparison - #3027

Open
LucaCappelletti94 wants to merge 1 commit into
upstream/null-test-spellingfrom
upstream/sqlite-is-null-precedence
Open

LucaCappelletti94 wants to merge 1 commit into
upstream/null-test-spellingfrom
upstream/sqlite-is-null-precedence

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

In SQLite IS and IS NOT are comparison operators that bind looser than +, so a IS NULL + 1 means a IS (NULL + 1). SQLiteDialect already parses IS as a binary operator, but the IS NULL, IS TRUE and IS FALSE shortcuts ran first and built (a IS NULL) + 1. For a = 5 SQLite returns 0 where the misread tree means 1.

Under supports_is_operator the parser now reads the right operand at = precedence and keeps Expr::IsNull, Expr::IsTrue and the rest only when that operand is a bare NULL, TRUE or FALSE, so a IS NULL alone keeps its tree.

@LucaCappelletti94 LucaCappelletti94 added bug Something isn't working SQLite labels Nov 21, 2026
@codecov-commenter

codecov-commenter commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.56%. Comparing base (c0a0f32) to head (2668a65).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           upstream/null-test-spelling    #3027   +/-   ##
============================================================
  Coverage                        83.56%   83.56%           
============================================================
  Files                               42       42           
  Lines                            35706    35725   +19     
  Branches                         35706    35725   +19     
============================================================
+ Hits                             29836    29855   +19     
  Misses                            2432     2432           
  Partials                          3438     3438           

☔ 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.

@LucaCappelletti94
LucaCappelletti94 force-pushed the upstream/sqlite-is-null-precedence branch from 11712ff to 2668a65 Compare November 21, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working SQLite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants