-
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: fix register branch and flush undolog when affect row was zero #3522
Conversation
Signed-off-by: slievrly <slievrly@163.com>
@@ -279,10 +278,12 @@ protected void prepareUndoLog(TableRecords beforeImage, TableRecords afterImage) | |||
|
|||
TableRecords lockKeyRecords = sqlRecognizer.getSQLType() == SQLType.DELETE ? beforeImage : afterImage; | |||
String lockKeys = buildLockKey(lockKeyRecords); | |||
connectionProxy.appendLockKey(lockKeys); | |||
if (null != lockKeys) { |
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.
maybe you can put it in the connectionProxy# appendLockKey function
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.
If you put code in connectionProxy# appendLockKey
, it will still execute L284~L285.
please add test case |
Codecov Report
@@ Coverage Diff @@
## develop #3522 +/- ##
=============================================
+ Coverage 52.15% 52.16% +0.01%
+ Complexity 3510 3508 -2
=============================================
Files 638 638
Lines 21108 21109 +1
Branches 2613 2615 +2
=============================================
+ Hits 11009 11012 +3
+ Misses 9014 9012 -2
Partials 1085 1085
|
@@ -279,10 +278,12 @@ protected void prepareUndoLog(TableRecords beforeImage, TableRecords afterImage) | |||
|
|||
TableRecords lockKeyRecords = sqlRecognizer.getSQLType() == SQLType.DELETE ? beforeImage : afterImage; | |||
String lockKeys = buildLockKey(lockKeyRecords); | |||
connectionProxy.appendLockKey(lockKeys); | |||
if (null != lockKeys) { |
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.
the method return value , is from :
StringBuilder sb = new StringBuilder(); xxx return sb.toString();
It can not use null != lockkeys, should use if(!StringUtils.isBlank(lockKeys))
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.
+1
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.
if (rowsIncludingPK.size() == 0) {
return null;
}
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
Signed-off-by: slievrly slievrly@163.com
Ⅰ. Describe what this PR did
bugfix: fix register branch and flush undolog when affect row was zero
Ⅱ. Does this pull request fix one issue?
fix #3521
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews