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

bugfix: fix mariadb unable to create XA connection #3695

Merged
merged 6 commits into from
May 18, 2021

Conversation

funky-eyes
Copy link
Contributor

@funky-eyes funky-eyes commented Apr 30, 2021

Ⅰ. Describe what this PR did

如果引入了mariadb的驱动却没有引入mysql的,那么druid的MySqlUtils只会反射mysql的驱动来创建xaconnection,此时会抛出npe,mariadb xa模式就无法正常使用

Ⅱ. Does this pull request fix one issue?

fixes #3696

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@funky-eyes funky-eyes added mode: XA XA transaction mode module/rm-datasource rm-datasource module type: bug Category issues or prs related to bug. labels Apr 30, 2021
@funky-eyes funky-eyes added this to the 1.5.0 milestone Apr 30, 2021
@funky-eyes funky-eyes changed the title bugfix: mariadb unable to create XA connection bugfix: fix mariadb unable to create XA connection Apr 30, 2021
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2021

Codecov Report

Merging #3695 (b0d78c4) into develop (69d1297) will increase coverage by 0.00%.
The diff coverage is 18.18%.

❗ Current head b0d78c4 differs from pull request most recent head c2f8083. Consider uploading reports for the commit c2f8083 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3695   +/-   ##
==========================================
  Coverage      51.31%   51.32%           
- Complexity      3576     3577    +1     
==========================================
  Files            646      646           
  Lines          21809    21809           
  Branches        2738     2737    -1     
==========================================
+ Hits           11191    11193    +2     
+ Misses          9480     9479    -1     
+ Partials        1138     1137    -1     
Impacted Files Coverage Δ Complexity Δ
...main/java/io/seata/rm/datasource/util/XAUtils.java 20.00% <18.18%> (+8.00%) 4.00 <2.00> (+1.00)

@funky-eyes funky-eyes requested a review from slievrly May 4, 2021 04:25
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@qianxunclub
Copy link

SpringBoot:2.4.1
grpc-spring-boot-starter:2.11.0.RELEASE
mariadb
mybatis-plus

测试事务可以正常使用

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly merged commit b7943e9 into apache:develop May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mode: XA XA transaction mode module/rm-datasource rm-datasource module type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mariadb unable to create XA connection
5 participants