mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -422,6 +422,11 @@ public class SchemaRepository {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean visit(SQLAllColumnExpr x) {
|
||||
resolve(this, x);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(Option option) {
|
||||
return (options & option.mask) != 0;
|
||||
@@ -464,12 +469,41 @@ public class SchemaRepository {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean visit(SQLAllColumnExpr x) {
|
||||
resolve(this, x);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(Option option) {
|
||||
return (options & option.mask) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void resolve(SchemaResolveVisitor visitor, SQLAllColumnExpr x) {
|
||||
SQLSelectQueryBlock queryBlock = null;
|
||||
for (SQLObject parent = x.getParent(); parent != null; parent = parent.getParent()) {
|
||||
if (parent instanceof SQLTableSource) {
|
||||
return;
|
||||
}
|
||||
if (parent instanceof SQLSelectQueryBlock) {
|
||||
queryBlock = (SQLSelectQueryBlock) parent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (queryBlock == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
SQLTableSource from = queryBlock.getFrom();
|
||||
if (from == null || from instanceof SQLJoinTableSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
x.setResolvedTableSource(from);
|
||||
}
|
||||
|
||||
private void resolve(SchemaResolveVisitor visitor, SQLPropertyExpr x) {
|
||||
String owner = x.getOwnernName();
|
||||
if (owner == null) {
|
||||
|
||||
Reference in New Issue
Block a user