@@ -287,9 +287,18 @@ public void testLimitToPreventStackOverflowFromLargeComplexSubselectTree() {
287
287
}
288
288
289
289
public void testLimitStackOverflowForInAndLiteralsIsNotApplied () {
290
- int noChildren = 100_000 ;
290
+ int noChildren = 10_000 ;
291
291
LogicalPlan plan = parseStatement ("SELECT * FROM t WHERE a IN(" +
292
- Joiner .on ("," ).join (nCopies (noChildren , "a + b" )) + ")" );
292
+ Joiner .on ("," ).join (nCopies (noChildren , "a + 10" )) + "," +
293
+ Joiner .on ("," ).join (nCopies (noChildren , "-(-a - 10)" )) + "," +
294
+ Joiner .on ("," ).join (nCopies (noChildren , "20" )) + "," +
295
+ Joiner .on ("," ).join (nCopies (noChildren , "-20" )) + "," +
296
+ Joiner .on ("," ).join (nCopies (noChildren , "20.1234" )) + "," +
297
+ Joiner .on ("," ).join (nCopies (noChildren , "-20.4321" )) + "," +
298
+ Joiner .on ("," ).join (nCopies (noChildren , "1.1234E56" )) + "," +
299
+ Joiner .on ("," ).join (nCopies (noChildren , "-1.4321E-65" )) + "," +
300
+ Joiner .on ("," ).join (nCopies (noChildren , "'foo'" )) + "," +
301
+ Joiner .on ("," ).join (nCopies (noChildren , "'bar'" )) + ")" );
293
302
294
303
assertEquals (With .class , plan .getClass ());
295
304
assertEquals (Project .class , ((With ) plan ).child ().getClass ());
@@ -298,8 +307,17 @@ public void testLimitStackOverflowForInAndLiteralsIsNotApplied() {
298
307
assertEquals (In .class , filter .condition ().getClass ());
299
308
In in = (In ) filter .condition ();
300
309
assertEquals ("?a" , in .value ().toString ());
301
- assertEquals (noChildren , in .list ().size ());
302
- assertThat (in .list ().get (0 ).toString (), startsWith ("(a) + (b)#" ));
310
+ assertEquals (noChildren * 2 + 8 , in .list ().size ());
311
+ assertThat (in .list ().get (0 ).toString (), startsWith ("(a) + 10#" ));
312
+ assertThat (in .list ().get (noChildren ).toString (), startsWith ("-(-?a) - 10#" ));
313
+ assertEquals ("20" , in .list ().get (noChildren * 2 ).toString ());
314
+ assertEquals ("-20" , in .list ().get (noChildren * 2 + 1 ).toString ());
315
+ assertEquals ("20.1234" , in .list ().get (noChildren * 2 + 2 ).toString ());
316
+ assertEquals ("-20.4321" , in .list ().get (noChildren * 2 + 3 ).toString ());
317
+ assertEquals ("1.1234E56" , in .list ().get (noChildren * 2 + 4 ).toString ());
318
+ assertEquals ("-1.4321E-65" , in .list ().get (noChildren * 2 + 5 ).toString ());
319
+ assertEquals ("foo" , in .list ().get (noChildren * 2 + 6 ).toString ());
320
+ assertEquals ("bar" , in .list ().get (noChildren * 2 + 7 ).toString ());
303
321
}
304
322
305
323
public void testDecrementOfDepthCounter () {
0 commit comments