File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed
main/javacc/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,6 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
193
193
| <K_INTO:"INTO">
194
194
| <K_NULL:"NULL">
195
195
| <K_LIKE:"LIKE">
196
- | <K_REGEXP:"REGEXP">
197
- | <K_REGEXP_LIKE:"REGEXP_LIKE">
198
196
| <K_DROP:"DROP">
199
197
| <K_JOIN:"JOIN">
200
198
| <K_LEFT:"LEFT">
@@ -1285,27 +1283,13 @@ Expression Condition():
1285
1283
}
1286
1284
{
1287
1285
(LOOKAHEAD(SQLCondition()) result=SQLCondition()
1288
- | result=FunctionCondition ()
1289
- | result=RegularCondition ()
1286
+ | LOOKAHEAD(RegularCondition()) result=RegularCondition ()
1287
+ | result=Function ()
1290
1288
)
1291
1289
1292
1290
{ return result; }
1293
1291
}
1294
1292
1295
- Expression FunctionCondition():
1296
- {
1297
- Function result;
1298
- ExpressionList parameters;
1299
- }
1300
- {
1301
- <K_REGEXP_LIKE> { result = new Function(); result.setName("REGEXP_LIKE"); }
1302
- "("
1303
- parameters=SimpleExpressionList() { result.setParameters(parameters); }
1304
- ")"
1305
-
1306
- { return result; }
1307
- }
1308
-
1309
1293
Expression RegularCondition():
1310
1294
{
1311
1295
Expression result = null;
Original file line number Diff line number Diff line change @@ -1051,5 +1051,10 @@ public void testRegexpLike2() throws JSQLParserException {
1051
1051
String stmt = "SELECT CASE WHEN REGEXP_LIKE(first_name, '^Ste(v|ph)en$') THEN 1 ELSE 2 END FROM mytable" ;
1052
1052
assertSqlCanBeParsedAndDeparsed (stmt );
1053
1053
}
1054
+
1055
+ public void testBooleanFunction1 () throws JSQLParserException {
1056
+ String stmt = "SELECT * FROM mytable WHERE test_func(col1)" ;
1057
+ assertSqlCanBeParsedAndDeparsed (stmt );
1058
+ }
1054
1059
1055
1060
}
You can’t perform that action at this time.
0 commit comments