mysql support operator '||'

This commit is contained in:
温少
2012-04-26 11:01:59 +08:00
parent 3b9ff5521c
commit 563ba6dd3b
@@ -475,4 +475,25 @@ public class MySqlExprParser extends SQLExprParser {
return column;
}
public SQLExpr orRest(SQLExpr expr) throws ParserException {
for (;;) {
if (lexer.token() == Token.OR || lexer.token() == Token.BARBAR) {
lexer.nextToken();
SQLExpr rightExp = and();
expr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.BooleanOr, rightExp);
} else if (lexer.token() == Token.XOR) {
lexer.nextToken();
SQLExpr rightExp = and();
expr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.BooleanXor, rightExp);
} else {
break;
}
}
return expr;
}
}