Skip to content

fix: keep prefix NOT LIKE predicates typed - #26

Merged
kvlonge merged 3 commits into
mainfrom
fix/prefix-not-like
Sep 26, 2026
Merged

kvlonge merged 3 commits into
mainfrom
fix/prefix-not-like

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 26, 2026

Copy link
Copy Markdown

Why

A prefix NOT on a LIKE-family predicate (WHERE NOT x LIKE 'a%') was parsed into a typed predicate and then deliberately replaced with an opaque Raw node in every dialect except TSQL/Fabric. Validation, linting and other AST consumers could not see inside it, so a SQL build tool silently skipped checks on such queries.

Changes

  • Keep Not(Like(...)) / Not(ILike(...)) for prefix NOT, including ANY/ALL/SOME quantifiers and ESCAPE; ClickHouse's higher-precedence NOT handling is unchanged.
  • Regression tests across 14 dialects: precedence with AND/OR, repeated NOT, parentheses, related predicates (SIMILAR TO, REGEXP/RLIKE, GLOB, MATCH, IS DISTINCT FROM, EXISTS, IN subqueries), no Raw/Command nodes, stable generation and formatting, and missing-column detection inside the predicate.
  • Version 0.13.3.

Verification

  • Real DuckDB: 19 cases return identical results for original, generated and formatted SQL.
  • Snowflake fixture and replays unchanged (0/55 valid, 0/30 runtime-only blocked; DuckDB 0/24 valid blocked); lint-rust, fmt, test-python, consistency.

@kvlonge
kvlonge merged commit 76b4940 into main Sep 26, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant