pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix crash in postgres_fdw for provably-empty remote UPDATE/DELET 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix crash in postgres_fdw for provably-empty remote UPDATE/DELET @ 2021-07-07 19:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2021-07-07 19:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix crash in postgres_fdw for provably-empty remote UPDATE/DELETE. In 86dc90056, I'd written find_modifytable_subplan with the assumption that if the immediate child of a ModifyTable is a Result, it must be a projecting Result with a subplan. However, if the UPDATE or DELETE has a provably-constant-false WHERE clause, that's not so: we'll generate a dummy subplan with a childless Result. Add the missing null-check so we don't crash on such cases. Per report from Alexander Pyhalov. Discussion: https://postgr.es/m/b9a6f53549456b2f3e2fd150dcd79d72@postgrespro.ru Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b9734c13f168ef0d487aa122e486ca9b6dd6aa59 Modified Files -------------- contrib/postgres_fdw/expected/postgres_fdw.out | 20 ++++++++++++++++++++ contrib/postgres_fdw/postgres_fdw.c | 4 +++- contrib/postgres_fdw/sql/postgres_fdw.sql | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix crash in postgres_fdw for provably-empty remote UPDATE/DELET @ 2021-07-07 19:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2021-07-07 19:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix crash in postgres_fdw for provably-empty remote UPDATE/DELETE. In 86dc90056, I'd written find_modifytable_subplan with the assumption that if the immediate child of a ModifyTable is a Result, it must be a projecting Result with a subplan. However, if the UPDATE or DELETE has a provably-constant-false WHERE clause, that's not so: we'll generate a dummy subplan with a childless Result. Add the missing null-check so we don't crash on such cases. Per report from Alexander Pyhalov. Discussion: https://postgr.es/m/b9a6f53549456b2f3e2fd150dcd79d72@postgrespro.ru Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/30a35bca3f9306f87ca8db095ddac2ba62156934 Modified Files -------------- contrib/postgres_fdw/expected/postgres_fdw.out | 20 ++++++++++++++++++++ contrib/postgres_fdw/postgres_fdw.c | 4 +++- contrib/postgres_fdw/sql/postgres_fdw.sql | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-07-07 19:21 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-07-07 19:21 pgsql: Fix crash in postgres_fdw for provably-empty remote UPDATE/DELET Tom Lane <tgl@sss.pgh.pa.us> 2021-07-07 19:21 pgsql: Fix crash in postgres_fdw for provably-empty remote UPDATE/DELET 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