Skip to content

feat(syntax-coverage): give each repeated Snowflake list item its own obligations and fix the list parser bugs they found - #227

Merged
kvlonge merged 12 commits into
mainfrom
feat/syntax-list-items
Nov 14, 2026
Merged

kvlonge merged 12 commits into
mainfrom
feat/syntax-list-items

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Why

A repeated Snowflake list item ([ , <x> ... ]) had no case of its own for its second item, so reviewers could not confirm that the continued list parses and keeps each item. The new receipts also exposed parser bugs in lists and block bodies.

Changes

  • fix(syntax-coverage): a positive whose only SQL is documented SQL that Snowflake refuses stays observed (24 obligations, 6 forms).
  • feat: the obligation walk descends into list continuations (+3,396 obligations across 489 forms).
  • 8 parser fixes, each with a receipt regression test: trailing comma in lists, extra ; in blocks, strings in group name lists, string keys in header and secret maps, ALTER WAREHOUSE errors, DEFAULT on untyped columns, COPY columns starting with ., DEFINE TABLE keyless REFERENCES. Disagreements 840 to 715, none new.
  • fix(syntax-coverage): two walk bugs of this PR. A continuation after an optional first item now fills the second item, and a missing (/) in an elided group drops it. 50 corrected cases in 10 forms await receipts.
  • chore: 2,305 receipts pinned; 62 obligations settled; reopened forms re-reviewed (266 approved).

Verification

  • Verified forms: 2,826 to 2,757 of 3,479. Gross +3, drops 72, net -69.
  • 55 drops are rejections for tree defects that already existed: optional WITH lost 18, other structure 11, grammar drift 8, quoting lost 4, AS alias lost 4, raw type parameters 3, coverage case off-target 2, DEFINE read as OR ALTER 2, TEMP read as TEMPORARY 2, empty a..b name 1.
  • 17 drops wait on receipts:
    • 4 forms on the walk fix's corrected cases (network policy x2, packages policy, VALUES).
    • 13 forms on 22 cases. 17 were refused by the importer (error phase not established): errno 99310 (6), 90200 (4), 3523 (4), 391403, 3215, 1485. 5 were never captured: iceberg typed CTAS, interactive CLUSTER BY (2), failover ADD/REMOVE accounts.
  • make check-ci passes on the final head; syntax-coverage diff exits 0.

…tive renders the same SQL

A positive whose only SQL is documented SQL that Snowflake refuses is
now observed like that SQL, instead of counting as accepted. The
documented refusal it coincides with is therefore kept, where before it
was withdrawn as SQL the grammar also accepts.

Regenerated obligations: 24 added across 6 ddl forms, none removed or
changed.

Validation: obligation and grammar script tests, including a test that
fails without the change; fensu reports no faults.
… missing, class and wrong-kind obligations

The obligation walk now descends into a list continuation such as
[ , <x> ... ], so the second item gets the obligations the first one
has. Its positive is the minimal case with that list continued, and a
case that drops an item keeps the separator before it.

Regenerated obligations: 3,396 added across 489 forms, none removed or
changed; 70 more withdrawn as SQL another obligation already covers.

Validation: obligation and grammar script tests, including a list-item
test that fails without the walk; fensu reports no faults.
Value lists, tuples, integration and organization property lists, SET and
UNSET properties, routine and resource SET properties, external table file
format options, view row access policy columns, USE SECONDARY ROLES,
ORDER BY and DESCRIBE argument types accepted a comma with nothing after it.
The second-list-item receipts show Snowflake refuses each one as a syntax
error, while the same lists with an item after every comma still parse.
The two ORDER BY receipts this resolves leave the disagreement list.
Snowflake runs BEGIN NULL ; ; END ; and the same doubled semicolon in
loop, branch, CASE and exception handler bodies, so the scripting body now
skips extra semicolons after a member. A block that opens with a semicolon
is still refused, as Snowflake refuses it.
Replication and failover group properties that list names, such as
ALLOWED_SHARES and OBJECT_TYPES, take a single string, which Snowflake
rejects only after parsing, but Snowflake refuses a string after a comma as
a syntax error, in ALTER ... SET and in CREATE. CREATE also refuses a comma
that ends a list before the next property, as Snowflake does.
…et maps

HEADERS, SECRETS and WEBHOOK_HEADERS take a bare-word key only in their
first entry: after a comma Snowflake refuses one as a syntax error. The
check applies to routine properties, ALTER FUNCTION and PROCEDURE SET,
CREATE property lists and ALTER INTEGRATION SET. Other key = value lists,
such as tags, keep accepting word keys.
When the structured ALTER WAREHOUSE parse failed it fell back to raw text,
so ALTER WAREHOUSE v1 UNSET TAG v1 , 'v1' was accepted although Snowflake
refuses it. The structured parse now reports its error; all 210 recorded
ALTER WAREHOUSE receipts still agree.
An untyped column read DEFAULT as a custom data type, so
CREATE ICEBERG TABLE v1 ( v1 DEFAULT , v1 ) AS SELECT 1 parsed. Snowflake
refuses an untyped column with DEFAULT, with or without a value.
COPY INTO v1 FROM ( SELECT $1 , . $1 FROM @s1 ) fell back to a raw command
although Snowflake refuses it as a syntax error. The COPY grammar check now
refuses a dot after a comma or SELECT, as it already did after a string or
a reserved word.
Snowflake parses DEFINE TABLE ... ( v1 INT , ( v1 , v1 ) REFERENCES t ) and
REFERENCES t without columns, but refuses columns after the referenced
table. DEFINE TABLE now reads that element as an out-of-line constraint of
kind REFERENCES, so the omitted keyword stays visible; CREATE TABLE keeps
refusing it, as its receipts show. The two DEFINE TABLE receipts this
resolves leave the disagreement list.
…lake parses and record the re-reviews

Pin the evidence commit that holds the receipts for the second-list-item
cases. Settle the 62 obligations whose derived negative Snowflake parses:
47 second list items it fails only later, and 15 omitted statements in a
statement list, which leave an empty statement Snowflake runs. Regenerate
the obligations and marks.

Record the 266 forms approved under review brief version 1, each bound to
its fingerprint and definition, and re-record the baseline: 3 forms are
newly verified and 72 forms verified before are not, 59 of them rejected on
re-review and 13 waiting on receipts.
@kvlonge
kvlonge enabled auto-merge November 14, 2026 07:09
@kvlonge
kvlonge disabled auto-merge November 14, 2026 07:12
…st item, and drop the parenthesis of an elided group

Two list-item walk bugs rendered SQL that did not match its obligation:

- In `( [ <x> ] [ , <x> ... ] )` the continuation's cases left the
  optional first item out, so `( 'm' )` and `( m1 )` stood for the second
  item. The walk now renders the first item whenever it walks the
  continuation that repeats it.
- A missing `(` or `)` in an elided group such as `[ , ( ... ) ]` kept
  the parenthesis, because the group renders from a written clause. The
  dropped token is now removed from the written clause or repeat.

Regenerated: 18 omit-item obligations return in 8 security_admin forms,
VALUES and CREATE EXTERNAL VOLUME get their missing-parenthesis cases, and
the two VALUES settles made from the old SQL are removed. 50 new cases
await receipts, pinned at evidence 74ca5ca5; the baseline drops the 30
obligations whose claims rested on the old SQL.
@kvlonge
kvlonge enabled auto-merge November 14, 2026 07:55
@kvlonge
kvlonge added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 76df2b1 Nov 14, 2026
10 checks passed
@kvlonge
kvlonge deleted the feat/syntax-list-items branch November 14, 2026 08:54
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