pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
Дата
Msg-id E1rdc3c-000NXE-G6@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid dangling-pointer problem with partitionwise joins under GEQO.

build_child_join_sjinfo creates a derived SpecialJoinInfo in
the short-lived GEQO context, but afterwards the semi_rhs_exprs
from that may be used in a UniquePath for a child base relation.
This breaks the expectation that all base-relation-level structures
are in the planning-lifespan context, leading to use of a dangling
pointer with probable ensuing crash later on in create_unique_plan.
To fix, copy the expression trees when making a UniquePath.

Per bug #18360 from Alexander Lakhin.  This has been broken since
partitionwise joins were added, so back-patch to all supported
branches.

Discussion: https://postgr.es/m/18360-a23caf3157f34e62@postgresql.org

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ef0333e6763349b0553dad296cd88a82207d1348

Modified Files
--------------
src/backend/optimizer/util/pathnode.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix compiler warning on typedef redeclaration
Следующее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Replace lateral references to removed rels in subqueries