-
Notifications
You must be signed in to change notification settings - Fork 345
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
[Bug report] jdbc-mysql catalogs failed on mysql 8.x driver #3269
Comments
@kalencaya |
docker-compose.yml and jdbc properties
|
@yuqi1129 as you can see, I'm using |
OK, let me give it a try. |
@kalencaya |
It seems that the JDBC metadata is not very mature and stable. I'm afraid this is not the only issue that exists. We have addressed several issues with JDBC metadata such as mixed schema and catalog, wildcard issues, and so on. |
I'm willing to do this and pull requests |
This should be caused by
I'll pull requests to change it as follow, which works well on mysql and postgresql:
|
@kalencaya |
yes |
#3229 is a better solution |
Do you mean that #3229 can resolve this issue? @kalencaya |
I prefer this solution than #3229 , because it's more general |
this relies on jdbc driver api then appears more general. but different jdbc driver implementations have some difference, they may have a nonstandard jdbc driver implementation. actually, some dms (database management system) 、sql editor server or orm frameworks prefer to retrieve jdbc metadata through database internal metadata store tables not jdbc driver. more complicated than jdbc driver api way I'm affected by that and prefers to not rely too much on jdbc driver api. we may can't solve all jdbc metadata through jdbc driver api and have to query database internal metadata tables just a little opinion |
Please go ahead if it looks more elegant than #3229. #3229 will be modified based on your changes after your PR is merged. |
I'll pull requests recently and not block your subsequent works |
… cause list tables error on some jdbc 8.x driver (#3294) <!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[#123] feat(operator): support xxx" - "[#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? replace `DatabaseMetaData#getSchema` by `DatabaseMetaData#getCatalog` and provide a more general way to get tables through jdbc driver ### Why are the changes needed? jdbc driver `DatabaseMetaData#getSchema` method return null causes list tables failure on some jdbc mysql 8.x driver (mysql-connector-java-8.0.11). Fix: #3269 ### Does this PR introduce _any_ user-facing change? not ### How was this patch tested? (Please test your changes, and provide instructions on how to test it: 1. If you add a feature or fix a bug, add a test to cover your changes. 2. If you fix a flaky test, repeat it for many times to prove it works.) --------- Co-authored-by: wangqi <wangqi@xinxuan.net>
… cause list tables error on some jdbc 8.x driver (#3294) <!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[#123] feat(operator): support xxx" - "[#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? replace `DatabaseMetaData#getSchema` by `DatabaseMetaData#getCatalog` and provide a more general way to get tables through jdbc driver ### Why are the changes needed? jdbc driver `DatabaseMetaData#getSchema` method return null causes list tables failure on some jdbc mysql 8.x driver (mysql-connector-java-8.0.11). Fix: #3269 ### Does this PR introduce _any_ user-facing change? not ### How was this patch tested? (Please test your changes, and provide instructions on how to test it: 1. If you add a feature or fix a bug, add a test to cover your changes. 2. If you fix a flaky test, repeat it for many times to prove it works.) --------- Co-authored-by: wangqi <wangqi@xinxuan.net>
… cause list tables error on some jdbc 8.x driver (#3316) <!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[#123] feat(operator): support xxx" - "[#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? replace `DatabaseMetaData#getSchema` by `DatabaseMetaData#getCatalog` and provide a more general way to get tables through jdbc driver ### Why are the changes needed? jdbc driver `DatabaseMetaData#getSchema` method return null causes list tables failure on some jdbc mysql 8.x driver (mysql-connector-java-8.0.11). Fix: #3269 ### Does this PR introduce _any_ user-facing change? not ### How was this patch tested? (Please test your changes, and provide instructions on how to test it: 1. If you add a feature or fix a bug, add a test to cover your changes. 2. If you fix a flaky test, repeat it for many times to prove it works.) Co-authored-by: kalencaya <1942460489@qq.com> Co-authored-by: wangqi <wangqi@xinxuan.net>
…n null cause list tables error on some jdbc 8.x driver (apache#3294) <!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[apache#123] feat(operator): support xxx" - "[apache#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[apache#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? replace `DatabaseMetaData#getSchema` by `DatabaseMetaData#getCatalog` and provide a more general way to get tables through jdbc driver ### Why are the changes needed? jdbc driver `DatabaseMetaData#getSchema` method return null causes list tables failure on some jdbc mysql 8.x driver (mysql-connector-java-8.0.11). Fix: apache#3269 ### Does this PR introduce _any_ user-facing change? not ### How was this patch tested? (Please test your changes, and provide instructions on how to test it: 1. If you add a feature or fix a bug, add a test to cover your changes. 2. If you fix a flaky test, repeat it for many times to prove it works.) --------- Co-authored-by: wangqi <wangqi@xinxuan.net>
Version
main branch
Describe what's wrong
jdbc-mysql catalogs failed on mysql 8.x driver, but 5.x works well
Error message and/or stacktrace
How to reproduce
mount mysql 8.x driver to gravitino docker container on /root/gravitino/catalogs/jdbc-mysql/libs/mysql.jar and create jdbc-mysql catalog on gravitino ui
Additional context
No response
The text was updated successfully, but these errors were encountered: