-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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: when use Statement.executeBatch() api can not generate after … #4838
bugfix: when use Statement.executeBatch() api can not generate after … #4838
Conversation
…image and undo log
…image and undo log
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 请将作者与pr信息登记至changes文件夹中的中英两版develop.md中
TableRecords afterImage = afterImage(beforeImage); | ||
prepareUndoLog(beforeImage, afterImage); | ||
} | ||
return result; | ||
} | ||
|
||
protected boolean needUndoLog() throws Exception { |
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.
SQLexception
我建议直接删了这个判断影响行数先吧,或者你可以进行标记batch的动作再来决定是否进行相关判断 |
…image and undo log
@@ -126,6 +131,11 @@ public void addBatch(String sql) throws SQLException { | |||
|
|||
@Override | |||
public int[] executeBatch() throws SQLException { | |||
this.executeBatchApiUsed = true; |
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.
statement can be reuse,the variable can be reset?
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.
statement can be reuse,the variable can be reset?
emmm, 这个变量是用于判断是否曾经执行过 executeBatch 方法的,只要执行过就标记为 true;所以没有考虑是否需要恢复的问题; 当然,这里主要是为了解决 issue 对应的问题,或者有什么更好的方案吗? 因为我不确定把它 reset 了之后,未来会不会对后续的其它操作产生影响
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.
不重置,后续的statement执行时update(影响行数为0)时,也会生成后置镜像
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.
建议直接删除影响行数判断
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.
建议直接删除影响行数判断
好的,那这个 pr 我先删掉吧,等我研究出更好的方案再提个优化的 pr 好了
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.
建议直接删除影响行数判断
好的,那这个 pr 我先删掉吧,等我研究出更好的方案再提个优化的 pr 好了
可以的
Codecov Report
@@ Coverage Diff @@
## develop #4838 +/- ##
=============================================
+ Coverage 49.20% 49.40% +0.20%
- Complexity 4090 4116 +26
=============================================
Files 736 736
Lines 25723 25728 +5
Branches 3177 3178 +1
=============================================
+ Hits 12658 12712 +54
+ Misses 11716 11667 -49
Partials 1349 1349
|
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
…image and undo log
Ⅰ. Describe what this PR did
fix when use Statement.executeBatch() api can not generate undo log
Ⅱ. Does this pull request fix one issue?
fixes #4833
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews