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

DatabaseMetadata methods do not detect underscore '_' escaping #6

Open
ssainz opened this issue Mar 30, 2018 · 0 comments
Open

DatabaseMetadata methods do not detect underscore '_' escaping #6

ssainz opened this issue Mar 30, 2018 · 0 comments

Comments

@ssainz
Copy link

ssainz commented Mar 30, 2018

SQL uses underscore , '_', character in search pattern sentences that contain "LIKE" as a representation of any single character. Just like '%' is used to represent zero or more characters.

Ref: https://www.w3resource.com/sql/wildcards-like-operator/wildcards-underscore.php

In DatabaseMetadata methods (getColumns), many databases support these two wildcard characters (_, %).

In Mapd when fetching a table whose name contains '_' (e.g. 'customer_sales") , if the wildcard character is escaped (e.g. "customer\_sales"), the mapd driver will not find the table. This create trouble for reporting tools.

Mapd is not handling the escaped wildcard characters correctly in the DatabaseMetadata methods.

Also notice that MapD driver actually has implementation of DatabaseMetadata.getSearchStringEscape() to return "\" as well :)
Which is mentioned in JDBC API: https://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)

@ssainz ssainz changed the title DatabaseMetadata methods does not detect underscore '_' escaping DatabaseMetadata methods do not detect underscore '_' escaping Mar 30, 2018
@randyzwitch randyzwitch transferred this issue from heavyai/heavydb Jun 21, 2019
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

1 participant