File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
245245| <K_RECURSIVE:"RECURSIVE">
246246| <K_REFERENCES:"REFERENCES">
247247| <K_REGEXP: "REGEXP">
248+ | <K_RLIKE: "RLIKE">
248249| <K_REPLACE:"REPLACE">
249250| <K_RESTRICT: "RESTRICT">
250251| <K_RETURNING: "RETURNING">
@@ -1997,6 +1998,7 @@ Expression RegularCondition() #RegularCondition:
19971998 | "@@" { result = new Matches(); }
19981999 | "~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASESENSITIVE); }
19992000 | <K_REGEXP> [ <K_BINARY> { binary=true; } ] { result = new RegExpMySQLOperator(binary?RegExpMatchOperatorType.MATCH_CASESENSITIVE:RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
2001+ | <K_RLIKE> [ <K_BINARY> { binary=true; } ] { result = new RegExpMySQLOperator(binary?RegExpMatchOperatorType.MATCH_CASESENSITIVE:RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
20002002 | "~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
20012003 | "!~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASESENSITIVE); }
20022004 | "!~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASEINSENSITIVE); }
Original file line number Diff line number Diff line change @@ -1992,6 +1992,12 @@ public void testRegexpBinaryMySQL() throws JSQLParserException {
19921992 assertSqlCanBeParsedAndDeparsed (stmt );
19931993 }
19941994
1995+ public void testRlike () throws JSQLParserException {
1996+ String stmt = "SELECT * FROM mytable WHERE first_name RLIKE '^Ste(v|ph)en$'" ;
1997+ Statement st = CCJSqlParserUtil .parse (stmt );
1998+ assertStatementCanBeDeparsedAs (st , "SELECT * FROM mytable WHERE first_name REGEXP '^Ste(v|ph)en$'" );
1999+ }
2000+
19952001 public void testBooleanFunction1 () throws JSQLParserException {
19962002 String stmt = "SELECT * FROM mytable WHERE test_func(col1)" ;
19972003 assertSqlCanBeParsedAndDeparsed (stmt );
You can’t perform that action at this time.
0 commit comments