mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user