Skip to content

SQLite, PostgreSQL, DuckDB: Print postfix NOT NULL, NOTNULL and ISNULL as written - #3028

Open
LucaCappelletti94 wants to merge 1 commit into
postfix-isnull-operatorfrom
upstream/null-test-spelling
Open

LucaCappelletti94 wants to merge 1 commit into
postfix-isnull-operatorfrom
upstream/null-test-spelling

Conversation

@LucaCappelletti94

@LucaCappelletti94 LucaCappelletti94 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Postfix a NOT NULL + 1 means (a NOT NULL) + 1 in SQLite, but sqlparser printed it as a IS NOT NULL + 1. SQLite parses IS NOT as a binary operator that binds looser than +, so it reads that text as a IS NOT (NULL + 1). When a is NULL the input gives 1 and the printed text gives 0. Expr::IsNull and Expr::IsNotNull do not remember how they were written, so Display has no way to choose.

Both become struct variants whose syntax field records IS NULL, ISNULL, IS NOT NULL, NOT NULL or NOTNULL, and they print back as written.

@codecov-commenter

codecov-commenter commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.56%. Comparing base (d4d8308) to head (c0a0f32).

Files with missing lines Patch % Lines
src/ast/spans.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                     @@
##           postfix-isnull-operator    #3028      +/-   ##
===========================================================
+ Coverage                    83.54%   83.56%   +0.01%     
===========================================================
  Files                           42       42              
  Lines                        35682    35706      +24     
  Branches                     35682    35706      +24     
===========================================================
+ Hits                         29812    29836      +24     
  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/null-test-spelling branch from 9ce12a9 to c0a0f32 Compare November 21, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants