bug fixed for schema stat. for issue #2422

This commit is contained in:
wenshao
2018-03-22 21:53:08 +08:00
parent 23e68d13cb
commit d6812d290e
3 changed files with 79 additions and 0 deletions
@@ -747,6 +747,19 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
return new Column("UNKNOWN", column);
}
if (expr instanceof SQLMethodInvokeExpr) {
SQLMethodInvokeExpr methodInvokeExpr = (SQLMethodInvokeExpr) expr;
List<SQLExpr> arguments = methodInvokeExpr.getParameters();
long nameHash = methodInvokeExpr.methodNameHashCode64();
if (nameHash == FnvHash.Constants.DATE_FORMAT) {
if (arguments.size() == 2
&& arguments.get(0) instanceof SQLName
&& arguments.get(1) instanceof SQLCharExpr) {
return getColumn(arguments.get(0));
}
}
}
return null;
}