bug fixed for sql parser.

This commit is contained in:
wenshao
2017-08-02 09:33:24 +08:00
parent 10de17ba8a
commit 9df6894d83
12 changed files with 151 additions and 132 deletions
@@ -1764,10 +1764,17 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
}
public boolean visit(SQLDropTableStatement x) {
print0(ucase ? "DROP " : "drop ");
List<SQLCommentHint> hints = x.getHints();
if (hints != null) {
printAndAccept(hints, " ");
print(' ');
};
if (x.isTemporary()) {
print0(ucase ? "DROP TEMPORARY TABLE " : "drop temporary table ");
print0(ucase ? "TEMPORARY TABLE " : "temporary table ");
} else {
print0(ucase ? "DROP TABLE " : "drop table ");
print0(ucase ? "TABLE " : "table ");
}
if (x.isIfExists()) {
@@ -1056,6 +1056,9 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
}
if (column != null) {
SQLObject parent = x.getParent();
if (parent instanceof SQLSelectOrderByItem) {
parent = parent.getParent();
}
if (parent instanceof SQLPrimaryKey) {
column.setPrimaryKey(true);
} else if (parent instanceof SQLUnique) {