Skip to content

Commit c92892b

Browse files
kangkaisenimay
authored andcommitted
Fix UnionStmt toSql bug (#249)
1 parent 305762e commit c92892b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fe/src/main/java/org/apache/doris/analysis/UnionStmt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public String toSql() {
534534
StringBuilder strBuilder = new StringBuilder();
535535
Preconditions.checkState(operands.size() > 0);
536536
strBuilder.append(operands.get(0).getQueryStmt().toSql());
537-
for (int i = 1; i < operands.size() - i; ++i) {
537+
for (int i = 1; i < operands.size() - 1; ++i) {
538538
strBuilder.append(
539539
" UNION " + ((operands.get(i).getQualifier() == Qualifier.ALL) ? "ALL " : ""));
540540
if (operands.get(i).getQueryStmt() instanceof UnionStmt) {

0 commit comments

Comments
 (0)