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

[#3269] fix(jdbc-mysql): Solve DatabaseMetaData#getSchema return null cause list tables error on some jdbc 8.x driver #3316

Conversation

jerryshao
Copy link
Collaborator

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.)

… 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>
@jerryshao jerryshao added cherry-pick need backport Issues that need to backport to another branch labels May 9, 2024
@yuqi1129 yuqi1129 merged commit 84f8d5e into branch-0.5 May 10, 2024
22 checks passed
@yuqi1129 yuqi1129 deleted the cherry-pick-branch-0.5-bd282883f1727af0a31e73d2deecbf6fff2deed0 branch May 10, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick need backport Issues that need to backport to another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants