Commit 7d2e2cf
committed
SQL: Fix wrong appliance of StackOverflow limit for IN (#36724)
Fix grammar so that each element inside the list of values for IN
is a valueExpression and not a more generic expression. Introduce a
mapping for context names as some rules in the grammar are exited with
a different rule from the one they entered.This helps so that the decrement
of depth counts in the Parser's CircuitBreakerListener works correctly.
For the list of values for IN, don't count the
PrimaryExpressionContext as this is not visited on exitRule() due to
the peculiarity in our gramamr with the predicate and predicated.
Fixes: #365921 parent d41eb6f commit 7d2e2cf
File tree
5 files changed
+127
-18
lines changed- x-pack/plugin/sql/src
- main
- antlr
- java/org/elasticsearch/xpack/sql/parser
- test/java/org/elasticsearch/xpack/sql/parser
5 files changed
+127
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3363 | 3363 | | |
3364 | 3364 | | |
3365 | 3365 | | |
3366 | | - | |
3367 | | - | |
3368 | | - | |
3369 | | - | |
3370 | | - | |
3371 | | - | |
3372 | 3366 | | |
3373 | 3367 | | |
3374 | 3368 | | |
| |||
3449 | 3443 | | |
3450 | 3444 | | |
3451 | 3445 | | |
3452 | | - | |
| 3446 | + | |
3453 | 3447 | | |
3454 | 3448 | | |
3455 | 3449 | | |
| |||
3459 | 3453 | | |
3460 | 3454 | | |
3461 | 3455 | | |
3462 | | - | |
| 3456 | + | |
3463 | 3457 | | |
3464 | 3458 | | |
3465 | 3459 | | |
| |||
6616 | 6610 | | |
6617 | 6611 | | |
6618 | 6612 | | |
6619 | | - | |
| 6613 | + | |
6620 | 6614 | | |
6621 | 6615 | | |
6622 | 6616 | | |
| |||
Lines changed: 67 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
| |||
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
217 | | - | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
221 | 249 | | |
222 | 250 | | |
223 | 251 | | |
| |||
226 | 254 | | |
227 | 255 | | |
228 | 256 | | |
229 | | - | |
230 | | - | |
231 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
232 | 269 | | |
233 | 270 | | |
234 | 271 | | |
| |||
240 | 277 | | |
241 | 278 | | |
242 | 279 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 280 | + | |
| 281 | + | |
246 | 282 | | |
| 283 | + | |
| 284 | + | |
247 | 285 | | |
248 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
249 | 309 | | |
250 | 310 | | |
251 | 311 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
| |||
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| 40 | + | |
31 | 41 | | |
32 | 42 | | |
33 | 43 | | |
| |||
254 | 264 | | |
255 | 265 | | |
256 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
257 | 312 | | |
258 | 313 | | |
259 | 314 | | |
| |||
0 commit comments