Skip to content

Commit 85a3e69

Browse files
committed
1 parent 8d4b32a commit 85a3e69

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/net/sf/jsqlparser/statement/select/NestedBracketsPerformanceTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void testIssue496() throws JSQLParserException {
5151
@Test
5252
public void testIncreaseOfParseTime() throws JSQLParserException {
5353
long oldDurationTime = 1000;
54+
int countProblematic = 0;
5455
for (int i = 0; i < 20; i++) {
5556
String sql = "SELECT " + buildRecursiveBracketExpression("concat($1,'B')", "'A'", i) + " FROM mytbl";
5657
long startTime = System.currentTimeMillis();
@@ -60,8 +61,10 @@ public void testIncreaseOfParseTime() throws JSQLParserException {
6061
if (i > 0) {
6162
System.out.println("old duration " + oldDurationTime + " new duration time " + durationTime + " for " + sql);
6263
}
63-
6464
if (oldDurationTime * 10 < durationTime) {
65+
countProblematic++;
66+
}
67+
if (countProblematic > 5) {
6568
fail("too large increment of parsing time");
6669
}
6770

0 commit comments

Comments
 (0)