improved sql parser. bug fixed for oracle extract function. issue #1481

This commit is contained in:
wenshao
2016-11-25 17:28:26 +08:00
parent 8b8a3f9e50
commit 51a9a616dc
13 changed files with 93 additions and 210 deletions
@@ -351,6 +351,7 @@ public class SQLExprParser extends SQLParser {
case EXCEPTION:
case FUNCTION:
case IDENTITY:
case EXTRACT:
sqlExpr = new SQLIdentifierExpr(lexer.stringVal());
lexer.nextToken();
break;
@@ -801,6 +802,12 @@ public class SQLExprParser extends SQLParser {
exprList(methodInvokeExpr.getParameters(), methodInvokeExpr);
}
if (lexer.token() == Token.FROM) {
lexer.nextToken();
SQLExpr from = this.expr();
methodInvokeExpr.setFrom(from);
}
accept(Token.RPAREN);
if (lexer.token() == Token.OVER) {