mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for mysql parser
This commit is contained in:
@@ -52,7 +52,16 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
}
|
||||
|
||||
public SQLExpr relationalRest(SQLExpr expr) throws ParserException {
|
||||
if (lexer.token() == Token.IDENTIFIER && "REGEXP".equalsIgnoreCase(lexer.stringVal())) {
|
||||
if (identifierEquals("REGEXP")) {
|
||||
lexer.nextToken();
|
||||
SQLExpr rightExp = equality();
|
||||
|
||||
rightExp = relationalRest(rightExp);
|
||||
|
||||
return new SQLBinaryOpExpr(expr, SQLBinaryOperator.RegExp, rightExp);
|
||||
}
|
||||
|
||||
if (identifierEquals("RLIKE")) {
|
||||
lexer.nextToken();
|
||||
SQLExpr rightExp = equality();
|
||||
|
||||
@@ -78,7 +87,7 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
}
|
||||
|
||||
public SQLExpr notRationalRest(SQLExpr expr) {
|
||||
if (lexer.token() == Token.IDENTIFIER && "REGEXP".equalsIgnoreCase(lexer.stringVal())) {
|
||||
if (identifierEquals("REGEXP")) {
|
||||
lexer.nextToken();
|
||||
SQLExpr rightExp = primary();
|
||||
|
||||
@@ -86,6 +95,15 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
|
||||
return new SQLBinaryOpExpr(expr, SQLBinaryOperator.NotRegExp, rightExp);
|
||||
}
|
||||
|
||||
if (identifierEquals("RLIKE")) {
|
||||
lexer.nextToken();
|
||||
SQLExpr rightExp = primary();
|
||||
|
||||
rightExp = relationalRest(rightExp);
|
||||
|
||||
return new SQLBinaryOpExpr(expr, SQLBinaryOperator.NotRLike, rightExp);
|
||||
}
|
||||
|
||||
return super.notRationalRest(expr);
|
||||
}
|
||||
|
||||
+2
@@ -149,6 +149,8 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
public OracleSchemaStatVisitor(){
|
||||
this.variants.put("DUAL", null);
|
||||
this.variants.put("NOTFOUND", null);
|
||||
this.variants.put("TRUE", null);
|
||||
this.variants.put("FALSE", null);
|
||||
}
|
||||
|
||||
protected Column getColumn(SQLExpr expr) {
|
||||
|
||||
Reference in New Issue
Block a user