sql parser support > =

This commit is contained in:
wenshao
2012-08-22 20:41:35 +08:00
parent 65db445dc1
commit b9c2010eab
2 changed files with 9 additions and 2 deletions
@@ -930,9 +930,16 @@ public class SQLExprParser extends SQLParser {
SQLExpr rightExp;
if (lexer.token() == Token.LT) {
SQLBinaryOperator op = SQLBinaryOperator.LessThan;
lexer.nextToken();
if (lexer.token() == Token.EQ) {
lexer.nextToken();
op = SQLBinaryOperator.LessThanOrEqual;
}
rightExp = bitOr();
expr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.LessThan, rightExp);
expr = new SQLBinaryOpExpr(expr, op, rightExp);
// expr = relationalRest(expr);
} else if (lexer.token() == Token.LTEQ) {
lexer.nextToken();
@@ -23,7 +23,7 @@ public class OracleSelectTest37 extends OracleTest {
"select resource_value,count(resource_value) nums,http_method "
+ "from ( "
+ " select * from audit_url_log "
+ " where project_id = ? and to_char(begin_time,'yyyy-MM-dd') >= ? and to_char(begin_time,'yyyy-MM-dd') <= ? ) "
+ " where project_id = ? and to_char(begin_time,'yyyy-MM-dd') > = ? and to_char(begin_time,'yyyy-MM-dd') < = ? ) "
+ " group by resource_value,http_method having count(resource_value) > = ?"; //
OracleStatementParser parser = new OracleStatementParser(sql);