mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -456,22 +456,23 @@ public class OdpsOutputVisitor extends SQLASTOutputVisitor implements OdpsASTVis
|
||||
|
||||
printSelectList(x.getSelectList());
|
||||
|
||||
if (x.getFrom() != null) {
|
||||
SQLTableSource from = x.getFrom();
|
||||
if (from != null) {
|
||||
println();
|
||||
print0(ucase ? "FROM " : "from ");
|
||||
x.getFrom().accept(this);
|
||||
from.accept(this);
|
||||
}
|
||||
|
||||
if (x.getWhere() != null) {
|
||||
SQLExpr where = x.getWhere();
|
||||
if (where != null) {
|
||||
println();
|
||||
print0(ucase ? "WHERE " : "where ");
|
||||
if (x.getWhere().hasBeforeComment() && isPrettyFormat()) {
|
||||
if (where.hasBeforeComment() && isPrettyFormat()) {
|
||||
printlnComments(x.getWhere().getBeforeCommentsDirect());
|
||||
}
|
||||
|
||||
x.getWhere().setParent(x);
|
||||
x.getWhere().accept(this);
|
||||
if (x.getWhere().hasAfterComment() && isPrettyFormat()) {
|
||||
where.accept(this);
|
||||
if (where.hasAfterComment() && isPrettyFormat()) {
|
||||
print(' ');
|
||||
printlnComment(x.getWhere().getAfterCommentsDirect());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user