bug fixed for db2 sql parser. for issue #2304

This commit is contained in:
wenshao
2018-01-31 17:51:20 +08:00
parent 2a4b2e0a9b
commit d3266ca300
2 changed files with 73 additions and 0 deletions
@@ -107,6 +107,15 @@ public class DB2ExprParser extends SQLExprParser {
expr = new SQLIdentifierExpr("CURRENT TIME");
}
}
} else if (lexer.token() == Token.SCHEMA) {
if (expr instanceof SQLIdentifierExpr) {
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) expr;
if (identExpr.hashCode64() == FnvHash.Constants.CURRENT) {
lexer.nextToken();
expr = new SQLIdentifierExpr("CURRENT SCHEMA");
}
}
} else if (lexer.identifierEquals(FnvHash.Constants.MONTHS)) {
SQLIntervalExpr intervalExpr = new SQLIntervalExpr(expr, SQLIntervalUnit.MONTH);
lexer.nextToken();