mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved SchemaStatVisitor, support function condition
This commit is contained in:
@@ -383,6 +383,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
case GreaterThan:
|
||||
case GreaterThanOrEqual:
|
||||
case LessThan:
|
||||
case LessThanOrGreater:
|
||||
case LessThanOrEqual:
|
||||
case LessThanOrEqualOrGreaterThan:
|
||||
case Like:
|
||||
@@ -459,6 +460,14 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
if (aliasMap == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (expr instanceof SQLMethodInvokeExpr) {
|
||||
SQLMethodInvokeExpr methodInvokeExp = (SQLMethodInvokeExpr) expr;
|
||||
if (methodInvokeExp.getParameters().size() == 1) {
|
||||
SQLExpr firstExpr = methodInvokeExp.getParameters().get(0);
|
||||
return getColumn(firstExpr);
|
||||
}
|
||||
}
|
||||
|
||||
if (expr instanceof SQLPropertyExpr) {
|
||||
SQLExpr owner = ((SQLPropertyExpr) expr).getOwner();
|
||||
|
||||
Reference in New Issue
Block a user