Skip to content

Commit

Permalink
fix:当查询列包含常量拼接时解析主键字段进行条件拼接时会多出 where null=null (alibaba#2188)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaecfov authored and agapple committed Sep 16, 2019
1 parent 419a73b commit 365ca4d
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ public Map<String, List<FieldItem>> getColumnFields() {
.forEach((fieldName, fieldItem) -> fieldItem.getColumnItems().forEach(columnItem -> {
// TableItem tableItem = getAliasTableItems().get(columnItem.getOwner());
// if (!tableItem.isSubQuery()) {
List<FieldItem> fieldItems = columnFields.computeIfAbsent(
columnItem.getOwner() + "." + columnItem.getColumnName(),
k -> new ArrayList<>());
fieldItems.add(fieldItem);
//当数据列并非原始列时,columnName是空的,例如concat('px',id)
if(columnItem.getColumnName() != null) {
List<FieldItem> fieldItems = columnFields.computeIfAbsent(
columnItem.getOwner() + "." + columnItem.getColumnName(),
k -> new ArrayList<>());
fieldItems.add(fieldItem);
}
// } else {
// tableItem.getSubQueryFields().forEach(subQueryField -> {
// List<FieldItem> fieldItems = columnFields.computeIfAbsent(
Expand Down

0 comments on commit 365ca4d

Please sign in to comment.