pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix missed step in removal of useless RESULT RTEs in the planner 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix missed step in removal of useless RESULT RTEs in the planner @ 2020-12-05 21:16 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-12-05 21:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix missed step in removal of useless RESULT RTEs in the planner. Commit 4be058fe9 forgot that the append_rel_list would already be populated at the time we remove useless result RTEs, and it might contain PlaceHolderVars that need to be adjusted like the ones in the main parse tree. This could lead to "no relation entry for relid N" failures later on, when the planner tries to do something with an unadjusted PHV. Per report from Tom Ellis. Back-patch to v12 where the bug came in. Discussion: https://postgr.es/m/20201205173056.GF30712@cloudinit-builder Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e98c900993e89ad9278cdfbf0ba5495381a1faac Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 1 + src/test/regress/expected/join.out | 36 +++++++++++++++++++++++++++++++ src/test/regress/sql/join.sql | 22 +++++++++++++++++++ 3 files changed, 59 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix missed step in removal of useless RESULT RTEs in the planner @ 2020-12-05 21:16 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-12-05 21:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix missed step in removal of useless RESULT RTEs in the planner. Commit 4be058fe9 forgot that the append_rel_list would already be populated at the time we remove useless result RTEs, and it might contain PlaceHolderVars that need to be adjusted like the ones in the main parse tree. This could lead to "no relation entry for relid N" failures later on, when the planner tries to do something with an unadjusted PHV. Per report from Tom Ellis. Back-patch to v12 where the bug came in. Discussion: https://postgr.es/m/20201205173056.GF30712@cloudinit-builder Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7d43b76f6ed97b3b27f30114636f7b116009ef61 Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 1 + src/test/regress/expected/join.out | 36 +++++++++++++++++++++++++++++++ src/test/regress/sql/join.sql | 22 +++++++++++++++++++ 3 files changed, 59 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix missed step in removal of useless RESULT RTEs in the planner @ 2020-12-05 21:16 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-12-05 21:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix missed step in removal of useless RESULT RTEs in the planner. Commit 4be058fe9 forgot that the append_rel_list would already be populated at the time we remove useless result RTEs, and it might contain PlaceHolderVars that need to be adjusted like the ones in the main parse tree. This could lead to "no relation entry for relid N" failures later on, when the planner tries to do something with an unadjusted PHV. Per report from Tom Ellis. Back-patch to v12 where the bug came in. Discussion: https://postgr.es/m/20201205173056.GF30712@cloudinit-builder Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/77a94c30da6152b9cbe5383d29e2aa9661260fbe Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 1 + src/test/regress/expected/join.out | 36 +++++++++++++++++++++++++++++++ src/test/regress/sql/join.sql | 22 +++++++++++++++++++ 3 files changed, 59 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-12-05 21:16 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-12-05 21:16 pgsql: Fix missed step in removal of useless RESULT RTEs in the planner Tom Lane <tgl@sss.pgh.pa.us> 2020-12-05 21:16 pgsql: Fix missed step in removal of useless RESULT RTEs in the planner Tom Lane <tgl@sss.pgh.pa.us> 2020-12-05 21:16 pgsql: Fix missed step in removal of useless RESULT RTEs in the planner Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox