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

optimize: optimize the get pks by auto when auto generated keys is false #3544

Merged
merged 12 commits into from
Mar 17, 2021

Conversation

caohdgege
Copy link
Contributor

Ⅰ. Describe what this PR did

MySQL插入的时候,如果getGeneratedKeys无法获取到主键,并且是批量插入的时候,原本的逻辑只能回滚第一条插入的数据,参考MySQL的jdbc驱动的StatementImpl的实现,在业务层进行自增长,保证回滚的时候可以回滚全部的数据。

Ⅱ. Does this pull request fix one issue?

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Feb 24, 2021

Codecov Report

Merging #3544 (f1c18c3) into develop (ad8aafa) will increase coverage by 0.00%.
The diff coverage is 62.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3544   +/-   ##
==========================================
  Coverage      51.94%   51.94%           
+ Complexity      3485     3484    -1     
==========================================
  Files            637      637           
  Lines          21079    21105   +26     
  Branches        2609     2614    +5     
==========================================
+ Hits           10949    10963   +14     
- Misses          9049     9057    +8     
- Partials        1081     1085    +4     
Impacted Files Coverage Δ Complexity Δ
.../rm/datasource/exec/mysql/MySQLInsertExecutor.java 69.41% <62.96%> (-3.47%) 16.00 <2.00> (+2.00) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 52.55% <0.00%> (-0.47%) 29.00% <0.00%> (ø%)
...in/java/io/seata/server/session/GlobalSession.java 83.04% <0.00%> (-0.44%) 75.00% <0.00%> (-1.00%)

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

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.

@xingfudeshi xingfudeshi merged commit 4a93b35 into apache:develop Mar 17, 2021
@funky-eyes funky-eyes added this to the 1.5.0 milestone Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants