-
Notifications
You must be signed in to change notification settings - Fork 8.9k
bugfix: fix load driver class in Hikari #7504
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… driver will use the correct class loader
…ifferent MySQL versions of drivers are used
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7504 +/- ##
============================================
+ Coverage 60.40% 60.41% +0.01%
- Complexity 658 662 +4
============================================
Files 1284 1298 +14
Lines 48465 49080 +615
Branches 5694 5770 +76
============================================
+ Hits 29276 29654 +378
- Misses 16572 16793 +221
- Partials 2617 2633 +16
🚀 New features to boost your workflow:
|
Member
Contributor
Author
done |
slievrly
approved these changes
Jul 9, 2025
Member
slievrly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
slievrly
pushed a commit
to slievrly/fescar
that referenced
this pull request
Oct 21, 2025
YvCeung
pushed a commit
to YvCeung/incubator-seata
that referenced
this pull request
Dec 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
Since Druid has
setDriverClassLoader(getDriverClassLoader()), andHikariConfighas no corresponding API, Druid can set the driver class loader normally, but Hikari cannot set the class loader directly.Here is my solution:
By calling the method of the abstract parent class, get the driver class loader, explicitly load and register the driver to DriverManager, and finally configure HikariConfig to solve this problem.
And use two test methods to test different MySQL driver situations to verify whether they can be loaded correctly.
Ⅱ. Does this pull request fix one issue?
fixes #7499
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
mvn clean test
Add two test methods based on the original
AbstractDataSourceProviderTesttest class to test whether different MySQL version drivers are loaded correctlyⅤ. Special notes for reviews