public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
6+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
@ 2024-02-23 20:22 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-02-23 20:22 UTC (permalink / raw)
  To: [email protected]

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/[email protected]

Branch
------
master

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

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
@ 2024-02-23 20:22 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-02-23 20:22 UTC (permalink / raw)
  To: [email protected]

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/[email protected]

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
@ 2024-02-23 20:22 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-02-23 20:22 UTC (permalink / raw)
  To: [email protected]

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/[email protected]

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/37bbe3d3acd62bad24493356a98579bd92c8f563

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
@ 2024-02-23 20:22 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-02-23 20:22 UTC (permalink / raw)
  To: [email protected]

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/[email protected]

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9061fd23c28faebcb29bdfb262975639715975c0

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
@ 2024-02-23 20:22 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-02-23 20:22 UTC (permalink / raw)
  To: [email protected]

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/[email protected]

Branch
------
REL_12_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid dangling-pointer problem with partitionwise joins under GE
@ 2024-02-23 20:22 Tom Lane <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2024-02-23 20:22 UTC (permalink / raw)
  To: [email protected]

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/[email protected]

Branch
------
REL_14_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2024-02-23 20:22 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 20:22 pgsql: Avoid dangling-pointer problem with partitionwise joins under GE Tom Lane <[email protected]>
2024-02-23 20:22 pgsql: Avoid dangling-pointer problem with partitionwise joins under GE Tom Lane <[email protected]>
2024-02-23 20:22 pgsql: Avoid dangling-pointer problem with partitionwise joins under GE Tom Lane <[email protected]>
2024-02-23 20:22 pgsql: Avoid dangling-pointer problem with partitionwise joins under GE Tom Lane <[email protected]>
2024-02-23 20:22 pgsql: Avoid dangling-pointer problem with partitionwise joins under GE Tom Lane <[email protected]>
2024-02-23 20:22 pgsql: Avoid dangling-pointer problem with partitionwise joins under GE Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox