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

feature: support mysql update join sql #4914

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
bugfix:compatible with multi update executor
  • Loading branch information
renliangyu857 committed Sep 7, 2022
commit 245d59fce8cf3a3cc34fa50b2c0a5ca377f744dc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ protected TableRecords afterImage(TableRecords beforeImage) throws SQLException
int itemTableIndex = tableItems.length == 1 ? 0 : 1; // if length > 1,consider update join sql
String unionTable = tableItems[0];
for (int i = itemTableIndex; i < tableItems.length; i++) {
TableRecords tableBeforeImage = beforeImagesMap.get(tableItems[i]);
//consider MultiUpdateExecutor regenerates updateExecutor object every time when doing afterImage
TableRecords tableBeforeImage = beforeImagesMap.get(tableItems[i]) == null ? beforeImage : beforeImagesMap.get(tableItems[i]);
String selectSQL = buildAfterImageSQL(unionTable, tableItems[i], tableBeforeImage);
ResultSet rs = null;
try (PreparedStatement pst = statementProxy.getConnection().prepareStatement(selectSQL)) {
Expand Down