forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4d5f651
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 parent811051c commit4d5f651
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 | |
---|---|---|---|
| |||
1084 | 1084 |
| |
1085 | 1085 |
| |
1086 | 1086 |
| |
1087 |
| - | |
1088 |
| - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1089 | 1091 |
| |
1090 | 1092 |
| |
1091 | 1093 |
| |
| |||
1099 | 1101 |
| |
1100 | 1102 |
| |
1101 | 1103 |
| |
1102 |
| - | |
1103 |
| - | |
| 1104 | + | |
1104 | 1105 |
| |
1105 | 1106 |
| |
1106 | 1107 |
| |
|
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)