Skip to content

Commit d30005b

Browse files
committed
disabled test for large cnf expansion and stack overflow problem
1 parent a8a0553 commit d30005b

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed

src/main/java/net/sf/jsqlparser/expression/BinaryExpression.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public abstract class BinaryExpression extends ASTNodeAccessImpl implements Expr
1919

2020
private Expression leftExpression;
2121
private Expression rightExpression;
22-
// private boolean not = false;
2322

2423
public BinaryExpression() {
2524
}
@@ -50,17 +49,6 @@ public void setRightExpression(Expression expression) {
5049
rightExpression = expression;
5150
}
5251

53-
// public void setNot() {
54-
// not = true;
55-
// }
56-
//
57-
// public void removeNot() {
58-
// not = false;
59-
// }
60-
//
61-
// public boolean isNot() {
62-
// return not;
63-
// }
6452
@Override
6553
public String toString() {
6654
return // (not ? "NOT " : "") +

src/test/java/net/sf/jsqlparser/util/cnfexpression/CNFTest.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
*/
1010
package net.sf.jsqlparser.util.cnfexpression;
1111

12+
import net.sf.jsqlparser.JSQLParserException;
1213
import net.sf.jsqlparser.expression.Expression;
1314
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
1415
import static org.junit.jupiter.api.Assertions.assertEquals;
16+
import org.junit.jupiter.api.Disabled;
1517
import org.junit.jupiter.api.Test;
1618

1719
public class CNFTest {
@@ -328,4 +330,48 @@ public void test5() throws Exception {
328330
assertEquals(expected.toString(), result.toString());
329331
}
330332

333+
@Test
334+
@Disabled
335+
public void testStackOverflowIssue1576() throws JSQLParserException {
336+
Expression expr = CCJSqlParserUtil.parseCondExpression(
337+
"((3.0 >= 4.0 AND 5.0 <= 6.0) OR "
338+
+ "(7.0 < 8.0 AND 9.0 > 10.0) OR "
339+
+ "(11.0 = 11.0 AND 19.0 > 20.0) OR "
340+
+ "(17.0 = 14.0 AND 19.0 > 17.0) OR "
341+
+ "(17.0 = 18.0 AND 20.0 > 20.0) OR "
342+
+ "(17.0 = 16.0 AND 19.0 > 20.0) OR "
343+
+ "(17.0 = 18.0 AND 19.0 > 20.0) OR "
344+
+ "(17.0 = 18.0 AND 19.0 > 20.0) OR "
345+
+ "(17.0 = 22.0 AND 19.0 > 20.0) OR "
346+
+ "(18.0 = 18.0 AND 22.0 > 20.0) OR "
347+
+ "(17.0 = 18.0 AND 19.0 > 20.0) OR "
348+
+ "(18.0 = 18.0 AND 22.0 > 20.0) OR "
349+
+ "(18.0 = 19.0 AND 22.0 > 20.0) OR "
350+
+ "(17.0 = 18.0 AND 19.0 > 20.0))"
351+
);
352+
353+
System.out.println(expr);
354+
355+
Expression result = CNFConverter.convertToCNF(expr);
356+
357+
System.out.println(result);
358+
}
359+
360+
@Test
361+
public void testStackOverflowIssue1576_2() throws JSQLParserException {
362+
Expression expr = CCJSqlParserUtil.parseCondExpression(
363+
"((3.0 >= 4.0 AND 5.0 <= 6.0) OR "
364+
+ "(7.0 < 8.0 AND 9.0 > 10.0) OR "
365+
+ "(11.0 = 11.0 AND 19.0 > 20.0) OR "
366+
+ "(17.0 = 14.0 AND 19.0 > 17.0) OR "
367+
+ "(17.0 = 18.0 AND 20.0 > 20.0) OR "
368+
+ "(17.0 = 16.0 AND 19.0 > 20.0))"
369+
);
370+
371+
System.out.println(expr);
372+
373+
Expression result = CNFConverter.convertToCNF(expr);
374+
375+
System.out.println(result);
376+
}
331377
}

0 commit comments

Comments
 (0)