improved sql parser. issue #1416

This commit is contained in:
wenshao
2016-09-17 03:19:32 +08:00
parent 67f0945bcd
commit b6926501e7
6 changed files with 72 additions and 12 deletions
@@ -1035,9 +1035,17 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Printab
}
public boolean visit(SQLDeleteStatement x) {
print0(ucase ? "DELETE FROM " : "delete from ");
SQLTableSource from = x.getFrom();
x.getTableName().accept(this);
if (from == null) {
print0(ucase ? "DELETE FROM " : "delete from ");
x.getTableName().accept(this);
} else {
print0(ucase ? "DELETE " : "delete ");
x.getTableName().accept(this);
print0(ucase ? " FROM " : " from ");
from.accept(this);
}
if (x.getWhere() != null) {
println();