Skip to content

Fix double backtick wrapping in setCatalog and setSchema#1454

Open
no23reason wants to merge 2 commits into
databricks:mainfrom
no23reason:double-backticks
Open

Fix double backtick wrapping in setCatalog and setSchema#1454
no23reason wants to merge 2 commits into
databricks:mainfrom
no23reason:double-backticks

Conversation

@no23reason
Copy link
Copy Markdown

@no23reason no23reason commented May 19, 2026

Description

When catalog or schema names were passed already wrapped in backticks, setCatalog/setSchema would produce invalid SQL like

 SET CATALOG ``name``

Strip existing backticks before wrapping and before storing, so getCatalog/ getSchema always return the bare identifier name.

Testing

The changes are covered by unit tests.

Additional Notes to the Reviewer

This fixes #1453 and restores compatibility with v2 of the jdbc driver: it also allowed "pre-quoted" identifiers and handled them correctly.

When catalog or schema names were passed already wrapped in backticks,
setCatalog/setSchema would produce invalid SQL like SET CATALOG ``name``.
Strip existing backticks before wrapping and before storing, so getCatalog/
getSchema always return the bare identifier name.

Fixes databricks#1453

Signed-off-by: Dan Homola <dan.homola@hotmail.cz>
Copy link
Copy Markdown
Collaborator

@gopalldb gopalldb left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

@no23reason
Copy link
Copy Markdown
Author

Thanks for the review! I resolved the conflicts by merge, I hope that is ok. Or should I rebase instead?

Copy link
Copy Markdown
Collaborator

@msrathore-db msrathore-db left a comment

Choose a reason for hiding this comment

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

Thanks for the change

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.

[BUG] Redundant backticks in setSchema and setCatalog

3 participants