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: when use Statement.executeBatch() api can not generate after … #4838

Merged
merged 7 commits into from
Aug 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Add changes here for all PR submitted to the develop branch.

### bugfix:
- [[#4817](https://github.com/seata/seata/pull/4817)] fix in high version springboot property not Standard
- [[#4838](https://github.com/seata/seata/pull/4838)] fix when use Statement.executeBatch() can not generate undo log

### optimize:
- [[#4774](https://github.com/seata/seata/pull/4774)] optimize mysql8 dependencies for seataio/seata-server image
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### bugfix:
- [[#4817](https://github.com/seata/seata/pull/4817)] 修复高版本springboot配置不标准的问题
- [[#4838](https://github.com/seata/seata/pull/4838)] 修复使用 Statement.executeBatch() 时无法生成undo log 的问题

### optimize:
- [[#4774](https://github.com/seata/seata/pull/4774)] 优化 seataio/seata-server 镜像中的 mysql8 依赖
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ protected T executeAutoCommitFalse(Object[] args) throws Exception {
}
TableRecords beforeImage = beforeImage();
T result = statementCallback.execute(statementProxy.getTargetStatement(), args);
int updateCount = statementProxy.getUpdateCount();
if (updateCount > 0) {
TableRecords afterImage = afterImage(beforeImage);
prepareUndoLog(beforeImage, afterImage);
}
TableRecords afterImage = afterImage(beforeImage);
prepareUndoLog(beforeImage, afterImage);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public void testExecuteAutoCommitFalse() throws Exception {
Mockito.when(executor.getDbType()).thenReturn(JdbcConstants.ORACLE);
Mockito.doReturn(tableMeta).when(executor).getTableMeta();
Mockito.when(tableMeta.getPrimaryKeyOnlyName()).thenReturn(Collections.singletonList("id"));
TableRecords tableRecords = Mockito.mock(TableRecords.class);
Mockito.doReturn(tableRecords).when(executor).afterImage(Mockito.any());
Assertions.assertNull(executor.executeAutoCommitFalse(null));
}

Expand Down