Fix mishandling of whole-row Vars referencing a view or sub-select.
If such a Var appeared within a nested sub-select, we failed to translate it correctly during pullup of the view, because the recursive call to replace_rte_variables_mutator was looking for the wrong sublevels_up value. Bug was introduced during the addition of the PlaceHolderVar mechanism. Per bug #5514 from Marcos Castedo.
Showing
- src/backend/optimizer/prep/prepjointree.c 5 additions, 1 deletionsrc/backend/optimizer/prep/prepjointree.c
- src/test/regress/expected/subselect.out 30 additions, 0 deletionssrc/test/regress/expected/subselect.out
- src/test/regress/sql/subselect.sql 14 additions, 0 deletionssrc/test/regress/sql/subselect.sql
Loading
Please register or sign in to comment