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.getIndexInfo() should use FBDatabaseMetaData.Clause [JDBC561] #594

Closed
firebird-automations opened this issue Oct 30, 2018 · 3 comments

Comments

@firebird-automations
Copy link

Submitted by: Attila Molnár (e_pluribus_unum)

Hi Mark!

DatabaseMetaData .getTables/.getColumns/.getProcedures/.getProcedureColumns uses FBDatabaseMetaData.Clause but .getIndexInfo not. These calls should behave the same, so getIndexInfo also should use FBDatabaseMetaData.Clause.

Thank You!

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

This difference is intentional. The methods getTables, getColumns, getProcedures and getProcedureColumns take a **pattern** parameter for the names, meaning they accept like patterns, while getIndexInfo does not take a pattern, it accepts only the actual name of the table (not a pattern).

Check the javadoc of java.sql.DatabaseMetaData for this difference, specifically:

getIndexInfo: "table - a table name; must match the table name as it is stored in this database"

vs

getTables: "tableNamePattern - a table name pattern; must match the table name as it is stored in the database"

combined with the description of patterns in the class documentation:

"Some DatabaseMetaData methods take arguments that are String patterns. These arguments all have names such as fooPattern. Within a pattern String, "%" means match any substring of 0 or more characters, and "_" means match any one character. Only metadata entries matching the search pattern are returned. If a search pattern argument is set to null, that argument's criterion will be dropped from the search."

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Author

Commented by: Attila Molnár (e_pluribus_unum)

OK, I can accept this. I did not check the parameter name and documentation, I just assumed that it should be the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants