Skip to content

Commit

Permalink
MXP-2713 In case of a calculation view, the where clause is duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
kramerul committed Oct 9, 2024
1 parent f6bac9a commit 268bfcd
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,14 @@ protected Builder buildAggregate(Aggregate e, Builder builder,
}

if (!isStar) {
builder.setFrom(oldSelect.clone(oldSelect.getParserPosition()));
SqlNode newNode = oldSelect.clone(oldSelect.getParserPosition());
if ( oldSelect.getWhere() != null) builder.setWhere(null);
if ( oldSelect.getHaving() != null) builder.setHaving(null);
if ( oldSelect.getGroup() != null) builder.setGroupBy(null);
if ( oldSelect.getFetch() != null) builder.setFetch(null);
if ( oldSelect.getOffset() != null) builder.setOffset(null);
if ( oldSelect.getOrderList() != null) builder.setOrderBy(null);
builder.setFrom(newNode);
}
}

Expand Down

0 comments on commit 268bfcd

Please sign in to comment.