forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf819020
committed
Fix incautious CTE matching in rewriteSearchAndCycle().
This function looks for a reference to the recursive WITH CTE,but it checked only the CTE name not ctelevelsup, so that it couldseize on a lower CTE that happened to have the same name. Thiswould result in planner failures later, either weird errors such as"could not find attribute 2 in subquery targetlist", or crashesor assertion failures. The code also merely Assert'ed that it founda matching entry, which is not guaranteed at all by the parser.Per bugs #17320 and #17318 from Zhiyong Wu.Thanks to Kyotaro Horiguchi for investigation.Discussion:https://postgr.es/m/17320-70e37868182512ab@postgresql.orgDiscussion:https://postgr.es/m/17318-2eb65a3a611d2368@postgresql.org1 parentc1da0ac commitf819020
File tree
3 files changed
+36
-3
lines changed- src
- backend/rewrite
- test/regress
- expected
- sql
3 files changed
+36
-3
lines changedLines changed: 16 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
383 | 383 |
| |
384 | 384 |
| |
385 | 385 |
| |
386 |
| - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
387 | 394 |
| |
388 | 395 |
| |
389 | 396 |
| |
390 | 397 |
| |
391 | 398 |
| |
392 |
| - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
393 | 402 |
| |
394 | 403 |
| |
395 | 404 |
| |
396 | 405 |
| |
397 | 406 |
| |
398 |
| - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
399 | 412 |
| |
400 | 413 |
| |
401 | 414 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
846 | 846 |
| |
847 | 847 |
| |
848 | 848 |
| |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
849 | 859 |
| |
850 | 860 |
| |
851 | 861 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
464 | 464 |
| |
465 | 465 |
| |
466 | 466 |
| |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
467 | 477 |
| |
468 | 478 |
| |
469 | 479 |
| |
|
0 commit comments
Comments
(0)