File tree Expand file tree Collapse file tree
main/javacc/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,8 +195,8 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
195195| <K_CURRENT: "CURRENT">
196196| <K_ROW: "ROW">
197197| <K_RETURNING: "RETURNING">
198- | <K_REGEXP : "REGEXP">
199-
198+ | <K_REGEXP_B : "REGEXP BINARY">
199+ | <K_REGEXP: "REGEXP">
200200}
201201
202202TOKEN : /* Numeric Constants */
@@ -1281,6 +1281,7 @@ Expression RegularCondition():
12811281 | "@@" { result = new Matches(); }
12821282 | "~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASESENSITIVE); }
12831283 | <K_REGEXP> { result = new RegExpMySQLOperator(RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
1284+ | <K_REGEXP_B> { result = new RegExpMySQLOperator(RegExpMatchOperatorType.MATCH_CASESENSITIVE); }
12841285 | "~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
12851286 | "!~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASESENSITIVE); }
12861287 | "!~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASEINSENSITIVE); }
Original file line number Diff line number Diff line change @@ -1330,6 +1330,11 @@ public void testRegexpMySQL() throws JSQLParserException {
13301330 String stmt = "SELECT * FROM mytable WHERE first_name REGEXP '^Ste(v|ph)en$'" ;
13311331 assertSqlCanBeParsedAndDeparsed (stmt );
13321332 }
1333+
1334+ public void testRegexpBinaryMySQL () throws JSQLParserException {
1335+ String stmt = "SELECT * FROM mytable WHERE first_name REGEXP BINARY '^Ste(v|ph)en$'" ;
1336+ assertSqlCanBeParsedAndDeparsed (stmt );
1337+ }
13331338
13341339 public void testBooleanFunction1 () throws JSQLParserException {
13351340 String stmt = "SELECT * FROM mytable WHERE test_func(col1)" ;
You can’t perform that action at this time.
0 commit comments