- Notifications
You must be signed in to change notification settings - Fork5.3k
Commitb0cc0a7
committed
Calculate agglevelsup correctly when Aggref contains a CTE.
If an aggregate function call contains a sub-select that hasan RTE referencing a CTE outside the aggregate, we must treatthat reference like a Var referencing the CTE's query levelfor purposes of determining the aggregate's level. Otherwisewe might reach the nonsensical conclusion that the aggregateshould be evaluated at some query level higher than the CTE,ending in a planner error or a broken plan tree that causesexecutor failures.Bug: #19055Reported-by: BugForge <dllggyx@outlook.com>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/19055-6970cfa8556a394d@postgresql.orgBackpatch-through: 131 parent0951942 commitb0cc0a7
File tree
3 files changed
+75
-1
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+75
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
794 | 820 | | |
795 | 821 | | |
796 | 822 | | |
| |||
800 | 826 | | |
801 | 827 | | |
802 | 828 | | |
803 | | - | |
| 829 | + | |
804 | 830 | | |
805 | 831 | | |
806 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2297 | 2297 | | |
2298 | 2298 | | |
2299 | 2299 | | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
2300 | 2334 | | |
2301 | 2335 | | |
2302 | 2336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1100 | 1114 | | |
1101 | 1115 | | |
1102 | 1116 | | |
| |||
0 commit comments
Comments
(0)