improved postgresql sql parser support. support SIMILAR TO Operator. issue #1391

This commit is contained in:
wenshao
2016-09-19 13:23:29 +08:00
parent eaeb1e3eac
commit 0a3fbb639b
4 changed files with 67 additions and 0 deletions
@@ -1492,6 +1492,16 @@ public class SQLExprParser extends SQLParser {
}
} else if (lexer.token() == Token.IN) {
expr = inRest(expr);
} else if (JdbcConstants.POSTGRESQL.equals(lexer.dbType)
&& identifierEquals("SIMILAR")) {
lexer.nextToken();
accept(Token.TO);
rightExp = equality();
rightExp = relationalRest(rightExp);
expr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.SIMILAR_TO, rightExp, getDbType());
}
return expr;