Skip to content

fix(syntax): keep OR REPLACE and quoting on Snowflake database and schema clones - #56

Merged
kvlonge merged 3 commits into
mainfrom
fix/snowflake-clone-trees
Nov 5, 2026
Merged

kvlonge merged 3 commits into
mainfrom
fix/snowflake-clone-trees

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Fixes the auditor's D118 withholds on main 497ad27 (record c1a92df) for sf.ddl.create-database.create-database-clone (quoted names, OR REPLACE) and sf.ddl.create-schema.create-schema-clone (OR REPLACE).

  • CreateDatabase and CreateSchema gain or_replace, which is skipped when false so other trees are unchanged. OR REPLACE was parsed and then dropped.
  • A Snowflake database name keeps its quoting (parse_quoting_identifier).
  • tests/parser/test_snowflake_create_clone.rs pins the three trees.

The parser tests and the polyglot exact check pass. Gate: make check-merge RECORDER=0 is running on 0faa5be; the result will be posted here.

…clones

CreateDatabase and CreateSchema now record OR REPLACE, which was parsed
and dropped, and a Snowflake database name keeps its quoting.
Snowflake reads CREATE DATABASE ROLE ; and CREATE DATABASE ROLE CLONE d2
as a database named ROLE (recorded success); #55 took them as a database
role without a name.
Snowflake parses CREATE STREAM v1 CLONE v1 COPY = ( ) and fails later
(errno 1422), so the clone options now accept an empty kind list. Adds
regression cases for it and for CREATE DATABASE ROLE CLONE v1, and keeps
the database-role doc comment on one line.

kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Gate (D94) on c793813, base main 77e10ee:

  • CARGO_BUILD_JOBS=1 make check-merge RECORDER=0: exit 0 (syntax-coverage: 3475 forms checked, 0 problems).
  • Coverage diff on catalogue c9ce0ff with evidence 6649fa9, main binary against head binary: forms +0/-0, obligations +0/-0, nothing lost.
  • Receipt scan over every case, observe rows included: base accepted, head rejected: 0. Head accepted, base rejected: 7. Snowflake parsed 5 of those 7 (database-role-clone k2f294878f7ba 2003; create-stream-clone k6bedaffe7427, create-table-clone k78d7d9f59419 and iceberg-table-clone kdd9b422256c4, all 1422; create-database-role k9de9327a97ce accepted). The other 2 are unreceipted.
  • This fixes the three fix(syntax): parse Snowflake CLONE kinds and security AS REPLICA forms #55 regressions recorded in audit 38bed22: CREATE DATABASE ROLE ;, CREATE DATABASE ROLE CLONE v1 ; and CREATE STREAM v1 CLONE v1 COPY = ( ) ;. Each has a regression case in test_snowflake_create_clone.rs.
  • The database/schema clone withholds (OR REPLACE, quoted database names) are tree fixes. Their obligations were already satisfied, so the checker counts don't move; they clear when the auditor re-reads the trees.

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