Update Painless Loop Counter to be Higher (#22560)
Updated Painless loop counter to be 1000000 statements instead of 10000 for update queries.
This commit is contained in:
commit
97c4cd4812
|
@ -49,8 +49,10 @@ public final class CompilerSettings {
|
|||
|
||||
/**
|
||||
* The maximum number of statements allowed to be run in a loop.
|
||||
* For now the number is set fairly high to accommodate users
|
||||
* doing large update queries.
|
||||
*/
|
||||
private int maxLoopCounter = 10000;
|
||||
private int maxLoopCounter = 1000000;
|
||||
|
||||
/**
|
||||
* Whether to throw exception on ambiguity or other internal parsing issues. This option
|
||||
|
|
|
@ -148,10 +148,10 @@ public class WhenThingsGoWrongTests extends ScriptTestCase {
|
|||
|
||||
public void testLoopLimits() {
|
||||
// right below limit: ok
|
||||
exec("for (int x = 0; x < 9999; ++x) {}");
|
||||
exec("for (int x = 0; x < 999999; ++x) {}");
|
||||
|
||||
PainlessError expected = expectScriptThrows(PainlessError.class, () -> {
|
||||
exec("for (int x = 0; x < 10000; ++x) {}");
|
||||
exec("for (int x = 0; x < 1000000; ++x) {}");
|
||||
});
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
|
|
Loading…
Reference in New Issue