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

JDBC driver DatabaseMetadata.getColumns returns empty result set when pattern is specified for table name #10

Open
mainstreet439 opened this issue Jan 6, 2018 · 2 comments

Comments

@mainstreet439
Copy link

originally noted at https://community.mapd.com/t/jdbc-driver-databasemetadata-getcolumns-returns-empty-result-set-when-pattern-is-specified/925

MAPD version 3.3.1-20171108-32e7bcc

Calling DatabaseMetadata.getColumns passing a pattern character for the table name returns an empty ResultSet. Meanwhile patterns in the column name will work.

Logic to check tablename is incorrect (if ((tableNamePattern == null) || (tableNamePattern.equals(tableName)))) vs column name check if ((columnNamePattern == null) || (value.col_name.matches(modifiedColumnPattern)))

Returns 0 rows
ResultSet columns = dbMeta.getColumns( null, null, “%”, “%”);
ResultSet columns = dbMeta.getColumns( null, null, “T%”, “%”);
ResultSet columns = dbMeta.getColumns( null, null, "TLJA\_JP", "%");

Returns rows of table
ResultSet columns = dbMeta.getColumns( null, null, “TABLE1”, “%”);

https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getColumns-java.lang.String-java.lang.String-java.lang.String-java.lang.String-

@mainstreet439 mainstreet439 changed the title JDBC driver DatabaseMetadata.getColumns returns empty result set when pattern is specified JDBC driver DatabaseMetadata.getColumns returns empty result set when pattern is specified for table name Jan 6, 2018
@billmaimone
Copy link

Note related enhancement heavyai/heavydb#138. Good functional question is whether to also allow SQL-style pattern match in addition to or instead of regex. @niviksha

@mainstreet439
Copy link
Author

mainstreet439 commented Jan 9, 2018

@billmaimone - applications written to the JDBC specification would expect to be able to use
the meta characters defined in the API spec.

https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html

@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

2 participants