forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfd059ac
committed
Fix planner error with pulling up subquery expressions into function RTEs.
If a function-in-FROM laterally references the output of some sub-SELECTearlier in the FROM clause, and we are able to flatten that sub-SELECTinto the outer query, the expression(s) copied into the function RTEmissed being processed by eval_const_expressions. This'd lead to troubleand probable crashes at execution if such expressions containednamed-argument function call syntax or functions with defaulted arguments.The bug is masked if the query contains any explicit JOIN syntax, whichmay help explain why we'd not noticed.Per bug #17227 from Bernd Dorn. This is an oversight in commit7266d09,so back-patch to v13 where that came in.Discussion:https://postgr.es/m/17227-5a28ed1512189fa4@postgresql.org1 parent79c7fe1 commitfd059ac
File tree
3 files changed
+49
-4
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+49
-4
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1078 | 1078 |
| |
1079 | 1079 |
| |
1080 | 1080 |
| |
1081 |
| - | |
1082 |
| - | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1083 | 1085 |
| |
1084 | 1086 |
| |
1085 | 1087 |
| |
| |||
1093 | 1095 |
| |
1094 | 1096 |
| |
1095 | 1097 |
| |
1096 |
| - | |
1097 |
| - | |
| 1098 | + | |
1098 | 1099 |
| |
1099 | 1100 |
| |
1100 | 1101 |
| |
|
Lines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2416 | 2416 |
| |
2417 | 2417 |
| |
2418 | 2418 |
| |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + |
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
767 | 767 |
| |
768 | 768 |
| |
769 | 769 |
| |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + |
0 commit comments
Comments
(0)