aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-11-20 12:34:06 -0500
committerRobert Haas <rhaas@postgresql.org>2017-11-20 12:34:06 -0500
commit0510421ee091ee3ddabdd5bd7ed096563f6bf17f (patch)
tree59edfd855fa7117853e7f5e40d7725b4a771b1dc /src/backend/executor
parentf455e1125e2588d4cd4fc663c6a10da4e003a3b5 (diff)
downloadpostgresql-0510421ee091ee3ddabdd5bd7ed096563f6bf17f.tar.gz
postgresql-0510421ee091ee3ddabdd5bd7ed096563f6bf17f.zip
Tweak use of ExecContextForcesOids by Gather (Merge).
Specifically, pass the outer plan's PlanState instead of our own PlanState. At present, ExecContextForcesOids doesn't actually care which PlanState we pass; it just looks through to the underlying EState to find the result relation or top-level eflags. However, in the future it might care. If that happens, and if our goal is to get a tuple descriptor that matches that of the outer plan, then I think what we care about is whether the outer plan's context forces OIDs, rather than whether our own context forces OIDs, just as we use the outer node's target list rather than our own. Patch by me, reviewed by Amit Kapila. Discussion: http://postgr.es/m/CA+TgmoZ0ZL=cesZFq8c9NnfK6bqy-wwUd3_74iYGodYrSoQ7Fw@mail.gmail.com
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/nodeGather.c2
-rw-r--r--src/backend/executor/nodeGatherMerge.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/nodeGather.c b/src/backend/executor/nodeGather.c
index 07c62d2feab..30885e6f5c2 100644
--- a/src/backend/executor/nodeGather.c
+++ b/src/backend/executor/nodeGather.c
@@ -112,7 +112,7 @@ ExecInitGather(Gather *node, EState *estate, int eflags)
/*
* Initialize funnel slot to same tuple descriptor as outer plan.
*/
- if (!ExecContextForcesOids(&gatherstate->ps, &hasoid))
+ if (!ExecContextForcesOids(outerPlanState(gatherstate), &hasoid))
hasoid = false;
tupDesc = ExecTypeFromTL(outerNode->targetlist, hasoid);
ExecSetSlotDescriptor(gatherstate->funnel_slot, tupDesc);
diff --git a/src/backend/executor/nodeGatherMerge.c b/src/backend/executor/nodeGatherMerge.c
index 7dd655c4489..d81462e72b4 100644
--- a/src/backend/executor/nodeGatherMerge.c
+++ b/src/backend/executor/nodeGatherMerge.c
@@ -155,7 +155,7 @@ ExecInitGatherMerge(GatherMerge *node, EState *estate, int eflags)
* Store the tuple descriptor into gather merge state, so we can use it
* while initializing the gather merge slots.
*/
- if (!ExecContextForcesOids(&gm_state->ps, &hasoid))
+ if (!ExecContextForcesOids(outerPlanState(gm_state), &hasoid))
hasoid = false;
tupDesc = ExecTypeFromTL(outerNode->targetlist, hasoid);
gm_state->tupDesc = tupDesc;