Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape catalog name in DatabaseMetadata.getSchemas #715

Closed
fabiocorneti opened this issue Jun 3, 2018 · 2 comments
Closed

Escape catalog name in DatabaseMetadata.getSchemas #715

fabiocorneti opened this issue Jun 3, 2018 · 2 comments

Comments

@fabiocorneti
Copy link

Driver version or jar name

6.5.4-SNAPSHOT (15a01c9)

SQL Server version

microsoft/mssql-server-linux:2017-latest

Client operating system

OS X Sierra

Java/JVM version

Oracle 10.0.1

Table schema

None.

Problem description

If you have a catalog containing a - in the name (or other non alpha chars) and pass the catalog name to DatabaseMetadata.getSchema(String catalog, String schemaPattern), the method fails with a syntax exception as the catalog name is not escaped in the resulting query.

Expected behavior and actual behavior

I would expect the method to work with an unescaped catalog name as other metadata methods (e.g. getTables).

Repro code

See tests in fabiocorneti#1 .

@cheenamalhotra
Copy link
Member

Hi @fabiocorneti

This is a good finding. Please feel free to create a PR in this repository for adding this change to driver.
We appreciate and welcome contributions from the community.

We would like to review and merge this change in upcoming releases.

@rene-ye
Copy link
Member

rene-ye commented Jun 20, 2018

PR merged, closing issue.

@rene-ye rene-ye closed this as completed Jun 20, 2018
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

No branches or pull requests

3 participants