@@ -255,9 +255,9 @@ public void testLimitToPreventStackOverflowFromLargeBinaryBooleanExpression() {
255255 // 1000 elements is ok
256256 new SqlParser ().createExpression (join (" OR " , nCopies (1000 , "a = b" )));
257257
258- // 10000 elements cause stack overflow
258+ // 5000 elements cause stack overflow
259259 ParsingException e = expectThrows (ParsingException .class , () ->
260- new SqlParser ().createExpression (join (" OR " , nCopies (10000 , "a = b" ))));
260+ new SqlParser ().createExpression (join (" OR " , nCopies (5000 , "a = b" ))));
261261 assertThat (e .getMessage (),
262262 startsWith ("line -1:0: SQL statement is too large, causing stack overflow when generating the parsing tree: [" ));
263263 }
@@ -271,7 +271,7 @@ public void testLimitToPreventStackOverflowFromLargeUnaryArithmeticExpression()
271271
272272 // 5000 elements cause stack overflow
273273 ParsingException e = expectThrows (ParsingException .class , () -> new SqlParser ().createExpression (
274- join ("" , nCopies (5000 , "abs(" )).concat ("i" ).concat (join ("" , nCopies (5000 , ")" )))));
274+ join ("" , nCopies (1000 , "abs(" )).concat ("i" ).concat (join ("" , nCopies (1000 , ")" )))));
275275 assertThat (e .getMessage (),
276276 startsWith ("line -1:0: SQL statement is too large, causing stack overflow when generating the parsing tree: [" ));
277277 }
@@ -282,9 +282,9 @@ public void testLimitToPreventStackOverflowFromLargeBinaryArithmeticExpression()
282282 // 1000 elements is ok
283283 new SqlParser ().createExpression (join (" + " , nCopies (1000 , "a" )));
284284
285- // 10000 elements cause stack overflow
285+ // 5000 elements cause stack overflow
286286 ParsingException e = expectThrows (ParsingException .class , () ->
287- new SqlParser ().createExpression (join (" + " , nCopies (10000 , "a" ))));
287+ new SqlParser ().createExpression (join (" + " , nCopies (5000 , "a" ))));
288288 assertThat (e .getMessage (),
289289 startsWith ("line -1:0: SQL statement is too large, causing stack overflow when generating the parsing tree: [" ));
290290 }
@@ -298,11 +298,11 @@ public void testLimitToPreventStackOverflowFromLargeSubselectTree() {
298298 .concat ("t" )
299299 .concat (join ("" , nCopies (199 , ")" ))));
300300
301- // 1000 elements cause stack overflow
301+ // 500 elements cause stack overflow
302302 ParsingException e = expectThrows (ParsingException .class , () -> new SqlParser ().createStatement (
303- join (" (" , nCopies (1000 , "SELECT * FROM" ))
303+ join (" (" , nCopies (500 , "SELECT * FROM" ))
304304 .concat ("t" )
305- .concat (join ("" , nCopies (999 , ")" )))));
305+ .concat (join ("" , nCopies (499 , ")" )))));
306306 assertThat (e .getMessage (),
307307 startsWith ("line -1:0: SQL statement is too large, causing stack overflow when generating the parsing tree: [" ));
308308 }
0 commit comments