mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
imporoved sql parser.
This commit is contained in:
@@ -457,6 +457,11 @@ public class SchemaRepository {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLAlterViewStatement x) {
|
||||
acceptView(x);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLCreateIndexStatement x) {
|
||||
acceptCreateIndex(x);
|
||||
return false;
|
||||
@@ -515,6 +520,11 @@ public class SchemaRepository {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLAlterViewStatement x) {
|
||||
acceptView(x);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLCreateIndexStatement x) {
|
||||
acceptCreateIndex(x);
|
||||
return false;
|
||||
@@ -568,6 +578,11 @@ public class SchemaRepository {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLAlterViewStatement x) {
|
||||
acceptView(x);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLCreateIndexStatement x) {
|
||||
acceptCreateIndex(x);
|
||||
return false;
|
||||
@@ -706,6 +721,22 @@ public class SchemaRepository {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean acceptView(SQLAlterViewStatement x) {
|
||||
String schemaName = x.getSchema();
|
||||
|
||||
Schema schema = findSchema(schemaName, true);
|
||||
|
||||
String name = x.computeName();
|
||||
SchemaObject view = schema.findTableOrView(name);
|
||||
if (view != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SchemaObject object = new SchemaObjectImpl(name, SchemaObjectType.View, x.clone());
|
||||
schema.objects.put(object.nameHashCode64(), object);
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean acceptDropIndex(SQLDropIndexStatement x) {
|
||||
SQLName table = x.getTableName().getName();
|
||||
SchemaObject object = findTable(table);
|
||||
|
||||
Reference in New Issue
Block a user