修正运算符优先级别处理不当的问题

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@157 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-05-20 07:15:47 +00:00
parent 107b62f003
commit 856f0e6011
6 changed files with 62 additions and 40 deletions
@@ -52,7 +52,7 @@ public class MySqlExprParser extends SQLExprParser {
public SQLExpr relationalRest(SQLExpr expr) throws ParserException {
if (lexer.token() == Token.IDENTIFIER && "REGEXP".equalsIgnoreCase(lexer.stringVal())) {
lexer.nextToken();
SQLExpr rightExp = bitOr();
SQLExpr rightExp = equality();
rightExp = relationalRest(rightExp);
@@ -65,7 +65,7 @@ public class MySqlExprParser extends SQLExprParser {
public SQLExpr multiplicativeRest(SQLExpr expr) throws ParserException {
if (lexer.token() == Token.IDENTIFIER && "MOD".equalsIgnoreCase(lexer.stringVal())) {
lexer.nextToken();
SQLExpr rightExp = bitOr();
SQLExpr rightExp = primary();
rightExp = relationalRest(rightExp);
@@ -78,7 +78,7 @@ public class MySqlExprParser extends SQLExprParser {
public SQLExpr notRationalRest(SQLExpr expr) {
if (lexer.token() == Token.IDENTIFIER && "REGEXP".equalsIgnoreCase(lexer.stringVal())) {
lexer.nextToken();
SQLExpr rightExp = bitOr();
SQLExpr rightExp = primary();
rightExp = relationalRest(rightExp);