Skip to content

Commit 5b3ea03

Browse files
committed
simple improvements
1 parent 332d1e7 commit 5b3ea03

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/main/java/net/sf/jsqlparser/expression/operators/relational/RegExpMatchOperatorType.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@
22
* #%L
33
* JSQLParser library
44
* %%
5-
* Copyright (C) 2004 - 2013 JSQLParser
5+
* Copyright (C) 2004 - 2014 JSQLParser
66
* %%
77
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU Lesser General Public License as
9-
* published by the Free Software Foundation, either version 2.1 of the
8+
* it under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation, either version 2.1 of the
1010
* License, or (at your option) any later version.
1111
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Lesser Public License for more details.
1616
*
17-
* You should have received a copy of the GNU General Lesser Public
17+
* You should have received a copy of the GNU General Lesser Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
2020
* #L%
2121
*/
22-
2322
package net.sf.jsqlparser.expression.operators.relational;
2423

2524
/**

src/main/java/net/sf/jsqlparser/expression/operators/relational/RegExpMySQLOperator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
* #%L
33
* JSQLParser library
44
* %%
5-
* Copyright (C) 2004 - 2013 JSQLParser
5+
* Copyright (C) 2004 - 2014 JSQLParser
66
* %%
77
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU Lesser General Public License as
9-
* published by the Free Software Foundation, either version 2.1 of the
8+
* it under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation, either version 2.1 of the
1010
* License, or (at your option) any later version.
1111
*
1212
* This program is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Lesser Public License for more details.
1616
*
17-
* You should have received a copy of the GNU General Lesser Public
17+
* You should have received a copy of the GNU General Lesser Public
1818
* License along with this program. If not, see
1919
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
2020
* #L%

src/main/javacc/net/sf/jsqlparser/parser/JSqlParserCC.jj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,7 @@ Expression RegularCondition():
12621262
boolean not = false;
12631263
int oracleJoin=EqualsTo.NO_ORACLE_JOIN;
12641264
int oraclePrior=EqualsTo.NO_ORACLE_PRIOR;
1265+
boolean binary = false;
12651266
}
12661267
{
12671268
[ <K_PRIOR> { oraclePrior = EqualsTo.ORACLE_PRIOR_START; }]
@@ -1280,8 +1281,7 @@ Expression RegularCondition():
12801281
| "!=" { result = new NotEqualsTo("!="); }
12811282
| "@@" { result = new Matches(); }
12821283
| "~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASESENSITIVE); }
1283-
| LOOKAHEAD(2) <K_REGEXP> <K_BINARY> { result = new RegExpMySQLOperator(RegExpMatchOperatorType.MATCH_CASESENSITIVE); }
1284-
| <K_REGEXP> { result = new RegExpMySQLOperator(RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
1284+
| <K_REGEXP> [ <K_BINARY> { binary=true; } ] { result = new RegExpMySQLOperator(binary?RegExpMatchOperatorType.MATCH_CASESENSITIVE:RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
12851285
| "~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
12861286
| "!~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASESENSITIVE); }
12871287
| "!~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASEINSENSITIVE); }

0 commit comments

Comments
 (0)