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: forbidding execute SQL which update pk value #3129

Merged
merged 9 commits into from
Oct 22, 2020

Conversation

0000005
Copy link
Contributor

@0000005 0000005 commented Sep 18, 2020

Ⅰ. Describe what this PR did

Forbidding execute SQL which updates pk value.

Ⅱ. Does this pull request fix one issue?

#3066

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2020

Codecov Report

Merging #3129 into develop will increase coverage by 0.02%.
The diff coverage is 82.14%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3129      +/-   ##
=============================================
+ Coverage      50.58%   50.61%   +0.02%     
- Complexity      3105     3108       +3     
=============================================
  Files            599      599              
  Lines          19514    19521       +7     
  Branches        2408     2409       +1     
=============================================
+ Hits            9871     9880       +9     
+ Misses          8651     8649       -2     
  Partials         992      992              
Impacted Files Coverage Δ Complexity Δ
.../rm/datasource/exec/BaseTransactionalExecutor.java 61.24% <ø> (+3.10%) 29.00 <0.00> (+2.00)
...ta/rm/datasource/exec/AbstractDMLBaseExecutor.java 74.46% <57.14%> (-1.15%) 11.00 <4.00> (+2.00) ⬇️
...o/seata/rm/datasource/exec/BaseInsertExecutor.java 71.89% <87.50%> (ø) 83.00 <5.00> (ø)
.../seata/rm/datasource/exec/MultiUpdateExecutor.java 76.31% <100.00%> (+0.31%) 12.00 <0.00> (ø)
...va/io/seata/rm/datasource/exec/UpdateExecutor.java 81.81% <100.00%> (ø) 11.00 <0.00> (ø)
...o/seata/server/coordinator/DefaultCoordinator.java 54.63% <0.00%> (-0.52%) 28.00% <0.00%> (-1.00%)
...in/java/io/seata/server/session/GlobalSession.java 82.43% <0.00%> (-0.46%) 70.00% <0.00%> (-1.00%)
...torage/file/store/FileTransactionStoreManager.java 57.41% <0.00%> (+0.64%) 29.00% <0.00%> (+1.00%)

@funky-eyes funky-eyes requested review from jsbxyyx and l81893521 and removed request for jsbxyyx September 18, 2020 06:17
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

@codecov-io
Copy link

codecov-io commented Oct 10, 2020

Codecov Report

Merging #3129 into develop will increase coverage by 0.03%.
The diff coverage is 82.14%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3129      +/-   ##
=============================================
+ Coverage      50.40%   50.43%   +0.03%     
- Complexity      3124     3129       +5     
=============================================
  Files            594      594              
  Lines          19700    19707       +7     
  Branches        2460     2461       +1     
=============================================
+ Hits            9929     9939      +10     
+ Misses          8766     8765       -1     
+ Partials        1005     1003       -2     
Impacted Files Coverage Δ Complexity Δ
.../rm/datasource/exec/BaseTransactionalExecutor.java 61.24% <ø> (+3.10%) 29.00 <0.00> (+2.00)
...ta/rm/datasource/exec/AbstractDMLBaseExecutor.java 74.46% <57.14%> (-1.15%) 11.00 <4.00> (+2.00) ⬇️
...o/seata/rm/datasource/exec/BaseInsertExecutor.java 71.89% <87.50%> (ø) 83.00 <5.00> (ø)
.../seata/rm/datasource/exec/MultiUpdateExecutor.java 76.31% <100.00%> (+0.31%) 12.00 <0.00> (ø)
...va/io/seata/rm/datasource/exec/UpdateExecutor.java 77.04% <100.00%> (ø) 11.00 <0.00> (ø)
...in/java/io/seata/server/session/GlobalSession.java 82.88% <0.00%> (+0.45%) 71.00% <0.00%> (+1.00%)

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -172,4 +173,13 @@ public static boolean isLockRetryPolicyBranchRollbackOnConflict() {
return LOCK_RETRY_POLICY_BRANCH_ROLLBACK_ON_CONFLICT;
}
}

protected void isUpdatePkValue(List<String> updateColumns) {
Copy link
Member

Choose a reason for hiding this comment

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

return boolean? control of exception by caller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is unnecessary. It just checks if the param is legal. There is nothing to control by the caller.

Copy link
Member

Choose a reason for hiding this comment

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

this method is more suitable placed in UpdateExecutor or MultiUpdateExecutor. or rename method name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What method name do you want? Please give me some advice

Copy link
Member

Choose a reason for hiding this comment

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

how about assertContainsPKColumnName?

Copy link
Member

@jsbxyyx jsbxyyx 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
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@l81893521 l81893521 changed the title bugfix:update pk value bugfix: forbidding execute SQL which update pk value Oct 22, 2020
@l81893521 l81893521 added the module/rm-datasource rm-datasource module label Oct 22, 2020
@l81893521 l81893521 merged commit d08c0e9 into apache:develop Oct 22, 2020
@0000005 0000005 deleted the fix_update_pk_bug branch October 22, 2020 05:47
hicf pushed a commit to hicf/seata that referenced this pull request Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/rm-datasource rm-datasource module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants