Skip to content

Commit

Permalink
bugfix: null exception when sql columns is empty in insert on duplica…
Browse files Browse the repository at this point in the history
…te (apache#5033)
  • Loading branch information
renliangyu857 authored Oct 29, 2022
1 parent e10e36c commit 3745c21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#4978](https://github.com/seata/seata/pull/4978)] fix kryo support circular reference
- [[#5018](https://github.com/seata/seata/pull/5018)] fix loader path in startup scripts
- [[#5004](https://github.com/seata/seata/pull/5004)] fix duplicate image row for update join
- [[#5033](https://github.com/seata/seata/pull/5033)] fix null exception when sql columns is empty for insert on duplicate


### optimize:
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 @@ -29,6 +29,7 @@
- [[#4985](https://github.com/seata/seata/pull/4985)] 修复 undo_log id重复的问题
- [[#5018](https://github.com/seata/seata/pull/5018)] 修复启动脚本中 loader path 使用相对路径导致 server 启动失败问题
- [[#5004](https://github.com/seata/seata/pull/5004)] 修复mysql update join行数据重复的问题
- [[#5033](https://github.com/seata/seata/pull/5033)] 修复InsertOnDuplicateUpdate的SQL语句中无插入列字段导致的空指针问题


### optimize:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ public Map<String, ArrayList<Object>> buildImageParameters(SQLInsertRecognizer r
Map<Integer, ArrayList<Object>> parameters = ((PreparedStatementProxy) statementProxy).getParameters();
// VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
List<String> insertParamsList = recognizer.getInsertParamsValue();
List<String> insertColumns = recognizer.getInsertColumns();
List<String> sqlRecognizerColumns = recognizer.getInsertColumns();
List<String> insertColumns = CollectionUtils.isEmpty(sqlRecognizerColumns) ? new ArrayList<>(getTableMeta().getAllColumns().keySet()) : sqlRecognizerColumns;
int paramsindex = 1;
for (String insertParams : insertParamsList) {
String[] insertParamsArray = insertParams.split(",");
Expand Down

0 comments on commit 3745c21

Please sign in to comment.