Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1ce745

Browse files
committed
Doc: add comment about bug fixed in back branches as of3f7323c.
While the bug I just fixed in the back branches doesn't exist inHEAD, the requirement that MULTIEXPR SubPlans not share outputparameters still does. Add a comment to memorialize that, becauseperhaps it could be an issue again someday.Discussion:https://postgr.es/m/17596-c5357f61427a81dc@postgresql.org
1 parent924954c commitd1ce745

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎src/backend/executor/nodeSubplan.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ ExecScanSubPlan(SubPlanState *node,
245245
* ones, so this should be safe.) Unlike ExecReScanSetParamPlan, we do
246246
* *not* set bits in the parent plan node's chgParam, because we don't
247247
* want to cause a rescan of the parent.
248+
*
249+
* Note: we are also relying on MULTIEXPR SubPlans not sharing any output
250+
* parameters with other SubPlans, because if one does then it is unclear
251+
* which SubPlanState node the parameter's execPlan field will be pointing
252+
* to when we come to evaluate the parameter. We can allow plain initplan
253+
* SubPlans to share output parameters, because it doesn't actually matter
254+
* which initplan SubPlan we reference as long as they all point to the
255+
* same underlying subplan. However, that fails to hold for MULTIEXPRs
256+
* because they can have non-empty args lists, and the "same" args might
257+
* have mutated into different forms in different parts of a plan tree.
258+
* There is currently no problem because MULTIEXPR can appear only in an
259+
* UPDATE's top-level target list, so it won't get duplicated anyplace.
260+
* Postgres versions before v14 had to make concrete efforts to avoid
261+
* sharing output parameters across different clones of a MULTIEXPR, and
262+
* the problem could recur someday.
248263
*/
249264
if (subLinkType==MULTIEXPR_SUBLINK)
250265
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp