JDBC driver DatabaseMetadata.getColumns returns empty result set when pattern is specified


#1

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%”, “%”);

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-