Skip to content

Commit

Permalink
inner 1504 - fix or condition in on join filter
Browse files Browse the repository at this point in the history
  • Loading branch information
PanternBao authored and yanhuqing666 committed Jan 7, 2022
1 parent 0af53cc commit a49f5e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ protected void visit(JoinNode join) {
if (first) {
sqlBuilder.append(" on ");
} else {
joinOnFilterStr.append(" and ");
joinOnFilterStr.append(" and (");
}
joinOnFilterStr.append(join.getOtherJoinOnFilter());
if (!first) {
joinOnFilterStr.append(")");
}
}
sqlBuilder.append(joinOnFilterStr.toString());
if (join.isWithSubQuery() || isTopQuery) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,12 @@ private StringBuilder getJoinOn(JoinNode join) {
if (first) {
sqlBuilder.append(" on ");
} else {
joinOnFilterStr.append(" and ");
joinOnFilterStr.append(" and (");
}
joinOnFilterStr.append(join.getOtherJoinOnFilter());
if (!first) {
joinOnFilterStr.append(")");
}
}
return joinOnFilterStr;
}
Expand Down

0 comments on commit a49f5e4

Please sign in to comment.