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

Commit77c666f

Browse files
committed
Un-break EXPLAIN for Append plans. I messed this up a few days ago while
adding the ModifyTable node type --- I had been thinking ModifyTable shouldreplace Append as a special case in push_plan(), but actually both of themhave to be special-cased.
1 parentbe6899f commit77c666f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.312 2009/10/2817:36:50 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.313 2009/10/2818:51:56 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -3370,11 +3370,16 @@ static void
33703370
push_plan(deparse_namespace*dpns,Plan*subplan)
33713371
{
33723372
/*
3373-
* We special-case ModifyTable to pretend that the first child plan is the
3374-
* OUTER referent; otherwise normal. This is to support RETURNING lists
3375-
* containing references to non-target relations.
3373+
* We special-case Append to pretend that the first child plan is the
3374+
* OUTER referent; we have to interpret OUTER Vars in the Append's tlist
3375+
* according to one of the children, and the first one is the most
3376+
* natural choice. Likewise special-case ModifyTable to pretend that the
3377+
* first child plan is the OUTER referent; this is to support RETURNING
3378+
* lists containing references to non-target relations.
33763379
*/
3377-
if (IsA(subplan,ModifyTable))
3380+
if (IsA(subplan,Append))
3381+
dpns->outer_plan= (Plan*)linitial(((Append*)subplan)->appendplans);
3382+
elseif (IsA(subplan,ModifyTable))
33783383
dpns->outer_plan= (Plan*)linitial(((ModifyTable*)subplan)->plans);
33793384
else
33803385
dpns->outer_plan=outerPlan(subplan);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp