Repository navigation
Conversation
…ed dialect Lint passed the call-depth limit to the shared parser only, so Postgres, BigQuery and Databricks ignored it: a limit of 3 or 64 still linted 100 nested calls, and their native parsers refused at fixed depths below the documented ceiling (about 198 calls on BigQuery and Databricks, 299 on Postgres). Lint now checks the lexed tokens against the configured call depth and the 512-level parenthesis ceiling before parsing, in every dialect, so N nested calls lint and N+1 are refused with the function-nesting error. The BigQuery, Databricks and Postgres parsers' recursion bounds rise from 200, 200 and 300 to 600, past SQLQuack's fixed 512-call ceiling, so the configured limit decides first.
…red parser does At a limit of 512, Postgres, BigQuery and Databricks linted 512 nested calls, because their native path skipped the AST-depth guard that refuses the same statement in Snowflake, DuckDB and SQLite. The native path now runs that depth guard on its result, so every dialect refuses at the same point with the same error. A refusal at the ceiling now says why fewer than 512 calls fit: the maximum is 512, and the statement and every expression around the calls also count toward that limit, so at 512 a bare SELECT can nest at most 511 calls, and fewer fit inside an alias, comparison or CTE.
…epth In a fixture harness, lint reads FROM <empty_relation>() as a bare relation by blanking its parentheses before parsing. The new pre-parse depth check ran on the original tokens, so the blanked parentheses counted as one more call level: at a limit of 1, one call around a subquery reading the empty relation was refused. The check now reads the blanked text's tokens, as the parse does.
kvlonge
enabled auto-merge
November 19, 2026 02:00
kvlonge
disabled auto-merge
November 19, 2026 02:04
… something At the 512 ceiling, every tree-depth refusal said how many nested calls fit, even for SQL with no call, such as a long UNION ALL chain. The note now follows E_GUARD_AST_DEPTH_EXCEEDED only when the statement holds a call; other refusals keep the bare guard text. Lint and the shared parse entry point decide the same way, from the statement's tokens. BREAKING CHANGE: lint now refuses a Postgres, BigQuery or Databricks statement whose tree nests past 512 levels, as Snowflake, DuckDB and SQLite already did, so 600 UNION ALL operands or 600 `::` casts no longer lint in those dialects.
…ceiling parse_source_within, which convert and check use, refuses 600 UNION ALL operands at the 512 ceiling with the guard's own text and no note about nested calls.
kvlonge
enabled auto-merge
November 19, 2026 02:26
kvlonge
disabled auto-merge
November 19, 2026 02:43
Contributor
Author
|
Replaced by #269: the merge queue rebases, so the commit that makes lint refuse native trees past 512 levels needs |
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.
Why
max_function_call_depthonly bounded lint on Snowflake, DuckDB and SQLite. The Postgres, BigQuery and Databricks parsers ignored it:Changes
E_GUARD_FUNCTION_NESTING_DEPTH_EXCEEDED.UNION ALLoperands or::casts, as Snowflake and DuckDB already did.Verification
UNION ALLoperands get the bare refusal. It fails on main in the three native dialects.TRIM(calls parse in 0.37 s (release).make check-cion the head.