ES|QL: limit query depth to 500 levels (#108089)

This commit is contained in:
Luigi Dell'Aquila 2024-05-02 17:42:41 +02:00 committed by GitHub
parent 6d20cef931
commit b277d5b033
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 166 additions and 7 deletions

View file

@ -263,7 +263,7 @@ public class HeapAttackIT extends ESRestTestCase {
columns = columns.item(matchesMap().entry("name", "c").entry("type", "long"));
columns = columns.item(matchesMap().entry("name", "d").entry("type", "long"));
columns = columns.item(matchesMap().entry("name", "e").entry("type", "long"));
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 20; i++) {
columns = columns.item(matchesMap().entry("name", "i0" + i).entry("type", "long"));
}
assertMap(map, matchesMap().entry("columns", columns).entry("values", hasSize(10_000)));
@ -272,7 +272,7 @@ public class HeapAttackIT extends ESRestTestCase {
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/108104")
public void testTooManyEval() throws IOException {
initManyLongs();
assertCircuitBreaks(() -> manyEval(1000));
assertCircuitBreaks(() -> manyEval(490));
}
private Response manyEval(int evalLines) throws IOException {
@ -280,7 +280,7 @@ public class HeapAttackIT extends ESRestTestCase {
query.append("FROM manylongs");
for (int e = 0; e < evalLines; e++) {
query.append("\n| EVAL ");
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 20; i++) {
if (i != 0) {
query.append(", ");
}