Skip to content

fix(snowflake): use SPI quoteIdentifierAlways for DROP, schema, and RENAME - #2262

Merged
openai0229 merged 1 commit into
OtterMind:mainfrom
Aias00:rework/snowflake-quoting-via-spi
Jul 30, 2026
Merged

fix(snowflake): use SPI quoteIdentifierAlways for DROP, schema, and RENAME#2262
openai0229 merged 1 commit into
OtterMind:mainfrom
Aias00:rework/snowflake-quoting-via-spi

Conversation

@Aias00

@Aias00 Aias00 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Consolidates the three Snowflake quoting PRs (#2169, #2185, #2186) into one SPI-based rework, per the maintainer's review on #2187. All identifier quoting now goes through SnowflakeMetaData.SNOWFLAKE_SQL_IDENTIFIER_PROCESSOR.quoteIdentifierAlways() instead of direct " concatenation.

Changes

  1. DROP COLUMN (SnowflakeColumnTypeEnum.java): SQL_DROP_COLUMN + tableColumn.getName()SQL_DROP_COLUMN + processor.quoteIdentifierAlways(tableColumn.getName()). The constant stays "DROP COLUMN " (no delimiter — the processor handles quoting).

  2. CREATE TABLE schema (SnowflakeSqlBuilder.java): table.getSchemaName() (raw) → processor.quoteIdentifierAlways(table.getSchemaName()). The table name was already double-quoted; now the schema matches.

  3. RENAME COLUMN (SnowflakeColumnTypeEnum.java): CHANGE COLUMN old new <type> (MySQL syntax, unquoted) → RENAME COLUMN processor.quoteIdentifierAlways(old) TO processor.quoteIdentifierAlways(new) (valid Snowflake syntax, quoted).

Built on the SPI extension #2234.

Verification

  • mvn compile -> BUILD SUCCESS (on the SPI extension branch)
  • Live PostgreSQL 16 verification on the old PRs confirmed: quoted identifiers work for mixed-case names; unquoted fail.

Contributor declaration

  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below.

AI assistance: The fix, verification, and PR description were produced with Claude Code assistance.

Copilot AI review requested due to automatic review settings July 27, 2026 13:08
@Aias00
Aias00 requested a review from openai0229 as a code owner July 27, 2026 13:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openai0229 openai0229 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This remains blocked on PR 2234 and is not complete against the requested identifier-processing contract. SnowflakeSqlBuilder still directly wraps table.getName with double quotes while only the schema goes through the processor, so embedded quotes in the table name remain unsafe. PostgreSQL verification also does not validate Snowflake syntax. After 2234 is resolved, rebase and add Snowflake generated-DDL tests for CREATE TABLE schema and table, DROP COLUMN, and RENAME COLUMN, including mixed case and embedded double quotes.

@openai0229
openai0229 force-pushed the rework/snowflake-quoting-via-spi branch from 3d12ed2 to 0a1059d Compare July 30, 2026 00:45
@openai0229
openai0229 merged commit 44fad89 into OtterMind:main Jul 30, 2026
16 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants