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.getTables() is sensitive to the table name when table creation is not #22204

Closed
prrvchr opened this issue May 30, 2024 · 5 comments

Comments

@prrvchr
Copy link
Member

prrvchr commented May 30, 2024

Hi all,

I am trying to integrate the Trino JDBC driver into the jdbcDriverOOo extension which is a JDBC driver for LibreOffice Base.

When creating a table in Base table design two things are done:

  • a CREATE TABLE command is executed to create a new_table.
  • a query on DatabaseMetaData.getTables(new_table_catalog, new_table_schema, new_table_name, null) is done to retrieve the new created table.

It appears that just after the creation of a table it is not possible to find it with getTables() however after a certain delay this table is indeed found and returned by getTables()...

@ebyhr
Copy link
Member

ebyhr commented May 31, 2024

Can you reproduce the issue only using Trino JDBC driver without jdbcDriverOOo?

@prrvchr
Copy link
Member Author

prrvchr commented May 31, 2024

Well by doing more investigation I realized that I hadn't seen everything.

The table is well created, however its name is converted to lower case and DatabaseMetaData.getTables() cannot find it with its name given during creation if it contains capital letters...

@ebyhr
Copy link
Member

ebyhr commented May 31, 2024

It's related to #17. Let me close this issue.

@ebyhr ebyhr closed this as completed May 31, 2024
@prrvchr
Copy link
Member Author

prrvchr commented May 31, 2024

The workaround is to only create tables in lower case but do you have anything planned on your side to resolve this problem?

@prrvchr prrvchr changed the title java.sql.DatabaseMetadata.getTables() does not return a newly created table. DatabaseMetadata.getTables() is sensitive to the table name when table creation is not May 31, 2024
@prrvchr
Copy link
Member Author

prrvchr commented May 31, 2024

I don't know how Trino works, but if Trino handles table names only in lowercase then DatabaseMetaData.getTables() should perform case-insensitive comparisons?

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

No branches or pull requests

2 participants