improved sql parser. for issue #1637

This commit is contained in:
wenshao
2017-03-14 20:34:25 +08:00
parent aa8459e192
commit aa8cfcf4f8
8 changed files with 281 additions and 39 deletions
@@ -1192,6 +1192,11 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
print0(x.getCollate());
}
if (x.getNullsOrderType() != null) {
print(' ');
print0(x.getNullsOrderType().toFormalString());
}
return false;
}
@@ -1261,6 +1266,14 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
}
public boolean visit(SQLSelectStatement stmt) {
List<SQLCommentHint> headHints = stmt.getHeadHintsDirect();
if (headHints != null) {
for (SQLCommentHint hint : headHints) {
hint.accept(this);
println();
}
}
SQLSelect select = stmt.getSelect();
select.accept(this);