mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正运算符优先级别处理不当的问题
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@157 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user