File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/util/cnfexpression Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4661,7 +4661,7 @@ Expression LikeExpression(Expression leftExpression) #LikeExpression:
4661
4661
| token = <K_MATCH_REGEXP>
4662
4662
) { result.setLikeKeyWord( LikeExpression.KeyWord.from(token.image)); }
4663
4663
[ LOOKAHEAD(2) <K_BINARY> {result.setUseBinary(true); } ]
4664
- rightExpression=SimpleExpression ()
4664
+ rightExpression=Expression ()
4665
4665
[ LOOKAHEAD(2) <K_ESCAPE>
4666
4666
(
4667
4667
LOOKAHEAD(2) token = <S_CHAR_LITERAL> { result.setEscape( new StringValue( token.image ) ); }
@@ -5270,6 +5270,8 @@ Expression PrimaryExpression() #PrimaryExpression:
5270
5270
5271
5271
| retval=ConnectByRootOperator()
5272
5272
5273
+ | retval=ConnectByPriorOperator()
5274
+
5273
5275
| LOOKAHEAD(2, {!interrupted}) <K_ALL> { retval = new AllValue(); }
5274
5276
5275
5277
| LOOKAHEAD(2, {!interrupted}) retval=Column()
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ public void test2() throws Exception {
67
67
"((NOT (NOT 1.1 >= 2.3 OR 3.3 < 4.5)) OR "
68
68
+ "(S.A LIKE '\" %%%\" ' AND S.B = '\" orz\" '))" );
69
69
Expression expected = CCJSqlParserUtil .parseCondExpression (
70
- "(1.1 >= 2.3 OR S.A LIKE '\" %%%\" ') AND (1.1 >= 2.3 OR S.B = '\" orz\" ')"
71
- + " AND (NOT 3.3 < 4.5 OR S.A LIKE '\" %%%\" ') AND (NOT 3.3 < 4.5 OR S.B = '\" orz\" ')" );
70
+ "(S.A LIKE '\" %%%\" ' AND S.B = '\" orz\" ' OR 1.1 >= 2.3) AND (S.A LIKE '\" %%%\" ' AND S.B = '\" orz\" ' OR NOT 3.3 < 4.5)" );
72
71
Expression result = CNFConverter .convertToCNF (expr );
73
72
assertEquals (expected .toString (), result .toString ());
74
73
}
@@ -206,8 +205,7 @@ public void test5() throws Exception {
206
205
"NOT ((NOT (S.A > 3.5 AND S.B < 4)) OR "
207
206
+ "(S.C LIKE '\" %%\" ' OR S.D = {t '12:04:34'}))" );
208
207
Expression expected = CCJSqlParserUtil .parseCondExpression (
209
- "S.A > 3.5 AND S.B < 4 AND NOT S.C LIKE '\" %%\" ' "
210
- + "AND NOT S.D = {t '12:04:34'}" );
208
+ "S.A > 3.5 AND S.B < 4 AND NOT S.C LIKE '\" %%\" ' OR S.D = {t '12:04:34'}" );
211
209
Expression result = CNFConverter .convertToCNF (expr );
212
210
assertEquals (expected .toString (), result .toString ());
213
211
}
You can’t perform that action at this time.
0 commit comments