imporoved sql parser.

This commit is contained in:
wenshao
2017-10-15 03:13:30 +08:00
parent 0527591d6a
commit 7da600e088
117 changed files with 9172 additions and 491 deletions
@@ -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);