remove_rel_from_query() must clean up PlaceHolderVar.phrels fields.
While we got away with this sloppiness before, it's not okay now
that fee7b77b9 caused build_joinrel_tlist() to make use of phrels.
Per report from Robins Tharakan.
Richard Guo (some cosmetic tweaks by me)
Discussion: https://postgr.es/m/CAMbWs4_ngw9sKxpTE8hqk=-ooVX_CQP3DarA4HzkRMz_JKpTrA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/798c0176342150c8fe1404b0007b299db2e73ce0
Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c | 17 ++++++++++-------
src/test/regress/expected/join.out | 16 ++++++++++++++++
src/test/regress/sql/join.sql | 7 +++++++
3 files changed, 33 insertions(+), 7 deletions(-)