Commit 5f6f951
committed
Improve RowMark handling during Self-Join Elimination
The Self-Join Elimination SJE feature messes up keeping and removing RowMark's in remove_self_joins_one_group(). That didn't lead to user-level error, because the planned RowMark is only used to reference a rtable entry in later execution stages. An RTE entry for keeping and removing relations is identical and refers to the same relation OID. To reduce confusion and prevent future issues, this commit cleans up the code and fixes the incorrect behaviour. Furthermore, it includes sanity checks in setrefs.c on existing non-null RTE and RelOptInfo entries for each RowMark. Discussion: https://postgr.es/m/18c6bd6c-6d2a-419a-b0da-dfedef34b585%40gmail.com Author: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com> Backpatch-through: 181 parent d713cf9 commit 5f6f951
2 files changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
| |||
1978 | 1979 | | |
1979 | 1980 | | |
1980 | 1981 | | |
| 1982 | + | |
1981 | 1983 | | |
1982 | 1984 | | |
1983 | 1985 | | |
1984 | 1986 | | |
| 1987 | + | |
1985 | 1988 | | |
1986 | 1989 | | |
1987 | 1990 | | |
| |||
2193 | 2196 | | |
2194 | 2197 | | |
2195 | 2198 | | |
2196 | | - | |
| 2199 | + | |
2197 | 2200 | | |
2198 | 2201 | | |
2199 | 2202 | | |
2200 | 2203 | | |
2201 | | - | |
| 2204 | + | |
2202 | 2205 | | |
2203 | 2206 | | |
2204 | 2207 | | |
| |||
2253 | 2256 | | |
2254 | 2257 | | |
2255 | 2258 | | |
2256 | | - | |
| 2259 | + | |
2257 | 2260 | | |
2258 | 2261 | | |
2259 | 2262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
310 | 314 | | |
311 | 315 | | |
312 | 316 | | |
| |||
0 commit comments