mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved mysql parser. bug fixed for issue #2263
This commit is contained in:
@@ -5192,7 +5192,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
if (x.isTablespace()) {
|
||||
print0(ucase ? " TABLESPACE" : " tablespace");
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6225,4 +6225,23 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
x.getTo().accept(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLAlterTableExchangePartition x) {
|
||||
print0(ucase ? "EXCHANGE PARTITION " : "exchange partition ");
|
||||
x.getPartition().accept(this);
|
||||
print0(ucase ? " WITH TABLE " : " with table ");
|
||||
x.getTable().accept(this);
|
||||
|
||||
Boolean validation = x.getValidation();
|
||||
if (validation != null) {
|
||||
if (validation) {
|
||||
print0(ucase ? " WITH VALIDATION" : " with validation");
|
||||
} else {
|
||||
print0(ucase ? " WITHOUT VALIDATION" : " without validation");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,4 +823,7 @@ public interface SQLASTVisitor {
|
||||
|
||||
boolean visit(SQLAlterSequenceStatement x);
|
||||
void endVisit(SQLAlterSequenceStatement x);
|
||||
|
||||
boolean visit(SQLAlterTableExchangePartition x);
|
||||
void endVisit(SQLAlterTableExchangePartition x);
|
||||
}
|
||||
|
||||
@@ -1944,6 +1944,16 @@ public class SQLASTVisitorAdapter implements SQLASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLAlterTableExchangePartition x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(SQLAlterTableExchangePartition x) {
|
||||
|
||||
}
|
||||
|
||||
public final boolean isEnabled(VisitorFeature feature) {
|
||||
return VisitorFeature.isEnabled(this.features, feature);
|
||||
}
|
||||
|
||||
@@ -2441,4 +2441,13 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
public boolean visit(SQLCreateDatabaseStatement x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLAlterTableExchangePartition x) {
|
||||
SQLExprTableSource table = x.getTable();
|
||||
if (table != null) {
|
||||
table.accept(this);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user