Skip to content

Commit

Permalink
insert columns may need to be anti-escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
isharpever committed Feb 3, 2023
1 parent b6becd0 commit 8e03b4f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import io.seata.sqlparser.struct.SqlMethodExpr;
import io.seata.sqlparser.struct.SqlSequenceExpr;
import io.seata.sqlparser.struct.SqlDefaultExpr;
import io.seata.sqlparser.util.ColumnUtils;
import io.seata.sqlparser.util.JdbcConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -109,8 +110,9 @@ public boolean containsAnyPk() {
if (CollectionUtils.isEmpty(pkColumnNameList)) {
return false;
}
return pkColumnNameList.stream().anyMatch(pkColumn -> insertColumns.contains(pkColumn)
|| CollectionUtils.toUpperList(insertColumns).contains(pkColumn.toUpperCase()));
List<String> newColumns = ColumnUtils.delEscape(insertColumns, getDbType());
return pkColumnNameList.stream().anyMatch(pkColumn -> newColumns.contains(pkColumn)
|| CollectionUtils.toUpperList(newColumns).contains(pkColumn.toUpperCase()));
}

@Override
Expand Down

0 comments on commit 8e03b4f

Please sign in to comment.