-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Conversation
Codecov Report
@@ 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
|
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
Codecov Report
@@ 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
|
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
@@ -172,4 +173,13 @@ public static boolean isLockRetryPolicyBranchRollbackOnConflict() { | |||
return LOCK_RETRY_POLICY_BRANCH_ROLLBACK_ON_CONFLICT; | |||
} | |||
} | |||
|
|||
protected void isUpdatePkValue(List<String> updateColumns) { |
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.
return boolean? control of exception by caller?
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.
I think this is unnecessary. It just checks if the param is legal. There is nothing to control by the caller.
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.
this method is more suitable placed in UpdateExecutor or MultiUpdateExecutor. or rename method name.
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.
What method name do you want? Please give me some advice
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.
how about assertContainsPKColumnName
?
# Conflicts: # rm-datasource/src/main/java/io/seata/rm/datasource/exec/BaseInsertExecutor.java
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
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
Ⅰ. 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