@@ -294,9 +294,18 @@ public void testLimitToPreventStackOverflowFromLargeComplexSubselectTree() {
294294 }
295295
296296 public void testLimitStackOverflowForInAndLiteralsIsNotApplied () {
297- int noChildren = 100_000 ;
297+ int noChildren = 10_000 ;
298298 LogicalPlan plan = parseStatement ("SELECT * FROM t WHERE a IN(" +
299- Joiner .on ("," ).join (nCopies (noChildren , "a + b" )) + ")" );
299+ Joiner .on ("," ).join (nCopies (noChildren , "a + 10" )) + "," +
300+ Joiner .on ("," ).join (nCopies (noChildren , "-(-a - 10)" )) + "," +
301+ Joiner .on ("," ).join (nCopies (noChildren , "20" )) + "," +
302+ Joiner .on ("," ).join (nCopies (noChildren , "-20" )) + "," +
303+ Joiner .on ("," ).join (nCopies (noChildren , "20.1234" )) + "," +
304+ Joiner .on ("," ).join (nCopies (noChildren , "-20.4321" )) + "," +
305+ Joiner .on ("," ).join (nCopies (noChildren , "1.1234E56" )) + "," +
306+ Joiner .on ("," ).join (nCopies (noChildren , "-1.4321E-65" )) + "," +
307+ Joiner .on ("," ).join (nCopies (noChildren , "'foo'" )) + "," +
308+ Joiner .on ("," ).join (nCopies (noChildren , "'bar'" )) + ")" );
300309
301310 assertEquals (With .class , plan .getClass ());
302311 assertEquals (Project .class , ((With ) plan ).child ().getClass ());
@@ -305,8 +314,17 @@ public void testLimitStackOverflowForInAndLiteralsIsNotApplied() {
305314 assertEquals (In .class , filter .condition ().getClass ());
306315 In in = (In ) filter .condition ();
307316 assertEquals ("?a" , in .value ().toString ());
308- assertEquals (noChildren , in .list ().size ());
309- assertThat (in .list ().get (0 ).toString (), startsWith ("Add[?a,?b]" ));
317+ assertEquals (noChildren * 2 + 8 , in .list ().size ());
318+ assertThat (in .list ().get (0 ).toString (), startsWith ("Add[?a,10]#" ));
319+ assertThat (in .list ().get (noChildren ).toString (), startsWith ("Neg[Sub[Neg[?a]#" ));
320+ assertEquals ("20" , in .list ().get (noChildren * 2 ).toString ());
321+ assertEquals ("-20" , in .list ().get (noChildren * 2 + 1 ).toString ());
322+ assertEquals ("20.1234" , in .list ().get (noChildren * 2 + 2 ).toString ());
323+ assertEquals ("-20.4321" , in .list ().get (noChildren * 2 + 3 ).toString ());
324+ assertEquals ("1.1234E56" , in .list ().get (noChildren * 2 + 4 ).toString ());
325+ assertEquals ("-1.4321E-65" , in .list ().get (noChildren * 2 + 5 ).toString ());
326+ assertEquals ("'foo'=foo" , in .list ().get (noChildren * 2 + 6 ).toString ());
327+ assertEquals ("'bar'=bar" , in .list ().get (noChildren * 2 + 7 ).toString ());
310328 }
311329
312330 public void testDecrementOfDepthCounter () {
0 commit comments