mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for SQLBetweenExpr output. for issue #2593
This commit is contained in:
@@ -496,8 +496,28 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
print0(ucase ? " BETWEEN " : " between ");
|
||||
}
|
||||
|
||||
printExpr(beginExpr);
|
||||
print0(ucase ? " AND " : " and ");
|
||||
int lines = this.lines;
|
||||
if (beginExpr instanceof SQLBinaryOpExpr) {
|
||||
SQLBinaryOpExpr binaryOpBegin = (SQLBinaryOpExpr) beginExpr;
|
||||
incrementIndent();
|
||||
if (binaryOpBegin.isBracket() || binaryOpBegin.getOperator().isLogical()) {
|
||||
print('(');
|
||||
printExpr(beginExpr);
|
||||
print(')');
|
||||
} else {
|
||||
printExpr(beginExpr);
|
||||
}
|
||||
decrementIndent();
|
||||
} else {
|
||||
printExpr(beginExpr);
|
||||
}
|
||||
|
||||
if (lines != this.lines) {
|
||||
println();
|
||||
print0(ucase ? "AND " : "and ");
|
||||
} else {
|
||||
print0(ucase ? " AND " : " and ");
|
||||
}
|
||||
|
||||
printExpr(endExpr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user