pgsql: Fix segfault during EvalPlanQual with mix of local and foreign p
От | Heikki Linnakangas |
---|---|
Тема | pgsql: Fix segfault during EvalPlanQual with mix of local and foreign p |
Дата | |
Msg-id | E1mE6Ep-0008Id-UZ@gemulon.postgresql.org обсуждение исходный текст |
Ответы |
Re: pgsql: Fix segfault during EvalPlanQual with mix of local and foreign p
|
Список | pgsql-committers |
Fix segfault during EvalPlanQual with mix of local and foreign partitions. It's not sensible to re-evaluate a direct-modify Foreign Update or Delete during EvalPlanQual. However, ExecInitForeignScan() can still get called if a table mixes local and foreign partitions. EvalPlanQualStart() left the es_result_relations array uninitialized in the child EPQ EState, but ExecInitForeignScan() still expected to find it. That caused a segfault. Fix by skipping the es_result_relations lookup during EvalPlanQual processing. To make things a bit more robust, also skip the BeginDirectModify calls, and add a runtime check that ExecForeignScan() is not called on direct-modify foreign scans during EvalPlanQual processing. This is new in v14, commit 1375422c782. Before that, EvalPlanQualStart() copied the whole ResultRelInfo array to the EPQ EState. Backpatch to v14. Report and diagnosis by Andrey Lepikhov. Discussion: https://www.postgresql.org/message-id/cb2b808d-cbaa-4772-76ee-c8809bafcf3d%40postgrespro.ru Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c3928b467a4f0ed2b0ef21a33848e9fcdade37b4 Modified Files -------------- src/backend/executor/nodeForeignscan.c | 46 ++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-)
В списке pgsql-committers по дате отправления: