Skip to content

fix(snowflake): quote the dropped column name with double quotes - #2169

Closed
Aias00 wants to merge 1 commit into
OtterMind:mainfrom
Aias00:fix/2166-snowflake-drop-quote
Closed

fix(snowflake): quote the dropped column name with double quotes#2169
Aias00 wants to merge 1 commit into
OtterMind:mainfrom
Aias00:fix/2166-snowflake-drop-quote

Conversation

@Aias00

@Aias00 Aias00 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #2166

Summary

Snowflake DROP COLUMN emitted the name unquoted (SQL_DROP_COLUMN = "DROP COLUMN "); Snowflake uppercases unquoted identifiers, so a mixed-case column ("myCol") couldn't be dropped (resolves to MYCOL and fails). Changed the constant to include the opening double-quote and append the closing one, mirroring PostgreSQL and Snowflake's own buildCreateColumnSql.

Verification

  • mvn compile -> BUILD SUCCESS.

Contributor declaration

  • I linked the Issue that defines this change.
  • 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, or this PR contains no substantial AI-generated code.

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

DROP COLUMN emitted the name unquoted; Snowflake uppercases unquoted
identifiers, so mixed-case columns couldn't be dropped. Use double-quote
quoting, mirroring PostgreSQL and Snowflake's own buildCreateColumnSql.

Fixes OtterMind#2166

Co-Authored-By: Claude <noreply@anthropic.com>
@Aias00
Aias00 requested a review from openai0229 as a code owner July 26, 2026 07:52
Copilot AI review requested due to automatic review settings July 26, 2026 07:52

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.

@Aias00

Aias00 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Live-database verification (PostgreSQL 16)

Same bug class verified against PostgreSQL 16:

  • Quoted DROP COLUMN → ✅ success
  • Unquoted DROP COLUMN → ❌ column "mixedcasecol" does not exist (PG lowercases unquoted identifiers)

Snowflake has the same uppercasing behavior for unquoted identifiers.

@Aias00

Aias00 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #2262 which uses the SPI quoteIdentifierAlways method per the maintainer review on #2187.

@Aias00 Aias00 closed this Jul 27, 2026
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 27, 2026
Aias00 added a commit to Aias00/Chat2DB that referenced this pull request Jul 27, 2026
…ENAME

Replaces direct " concatenation with
SnowflakeMetaData.SNOWFLAKE_SQL_IDENTIFIER_PROCESSOR.quoteIdentifierAlways
for DROP COLUMN, CREATE TABLE schema qualifier, and RENAME COLUMN.
CHANGE COLUMN (MySQL syntax) is replaced with RENAME COLUMN (Snowflake).
Built on the SPI extension (OtterMind#2234).

Closes OtterMind#2169, OtterMind#2185, OtterMind#2186 (superseded by this SPI-based approach)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

Snowflake DROP COLUMN does not quote the column name (mixed-case columns can't be dropped)

3 participants