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

Commit4dd2048

Browse files
committed
Get rid of ExecAssignResultTypeFromOuterPlan() and make all plan node types
generate their output tuple descriptors from their target lists (ie, usingExecAssignResultTypeFromTL()). We long ago fixed things so that all nodetypes have minimally valid tlists, so there's no longer any good reason tohave two different ways of doing it. This change is needed to fix bugreported by Hayden James: the fix of 2005-11-03 to emit the correct columnnames after optimizing away a SubqueryScan node didn't work if the newtop-level plan node used ExecAssignResultTypeFromOuterPlan to generate itstupdesc, since the next plan node down won't have the correct column labels.
1 parent19ff959 commit4dd2048

File tree

8 files changed

+14
-31
lines changed

8 files changed

+14
-31
lines changed

‎src/backend/executor/execUtils.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.128 2005/11/22 18:17:10 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.129 2005/11/23 20:27:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -435,22 +435,6 @@ ExecAssignResultType(PlanState *planstate,
435435
ExecSetSlotDescriptor(slot,tupDesc,shouldFree);
436436
}
437437

438-
/* ----------------
439-
*ExecAssignResultTypeFromOuterPlan
440-
* ----------------
441-
*/
442-
void
443-
ExecAssignResultTypeFromOuterPlan(PlanState*planstate)
444-
{
445-
PlanState*outerPlan;
446-
TupleDesctupDesc;
447-
448-
outerPlan=outerPlanState(planstate);
449-
tupDesc=ExecGetResultType(outerPlan);
450-
451-
ExecAssignResultType(planstate,tupDesc, false);
452-
}
453-
454438
/* ----------------
455439
*ExecAssignResultTypeFromTL
456440
* ----------------

‎src/backend/executor/nodeHash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.98 2005/11/22 18:17:10 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.99 2005/11/23 20:27:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -164,7 +164,7 @@ ExecInitHash(Hash *node, EState *estate)
164164
* initialize tuple type. no need to initialize projection info because
165165
* this node doesn't do projections
166166
*/
167-
ExecAssignResultTypeFromOuterPlan(&hashstate->ps);
167+
ExecAssignResultTypeFromTL(&hashstate->ps);
168168
hashstate->ps.ps_ProjInfo=NULL;
169169

170170
returnhashstate;

‎src/backend/executor/nodeLimit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeLimit.c,v 1.22 2005/10/15 02:49:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeLimit.c,v 1.23 2005/11/23 20:27:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -327,7 +327,7 @@ ExecInitLimit(Limit *node, EState *estate)
327327
* limit nodes do no projections, so initialize projection info for this
328328
* node appropriately
329329
*/
330-
ExecAssignResultTypeFromOuterPlan(&limitstate->ps);
330+
ExecAssignResultTypeFromTL(&limitstate->ps);
331331
limitstate->ps.ps_ProjInfo=NULL;
332332

333333
returnlimitstate;

‎src/backend/executor/nodeMaterial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.50 2005/10/15 02:49:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.51 2005/11/23 20:27:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -195,7 +195,7 @@ ExecInitMaterial(Material *node, EState *estate)
195195
* initialize tuple type. no need to initialize projection info because
196196
* this node doesn't do projections.
197197
*/
198-
ExecAssignResultTypeFromOuterPlan(&matstate->ss.ps);
198+
ExecAssignResultTypeFromTL(&matstate->ss.ps);
199199
ExecAssignScanTypeFromOuterPlan(&matstate->ss);
200200
matstate->ss.ps.ps_ProjInfo=NULL;
201201

‎src/backend/executor/nodeSetOp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $PostgreSQL: pgsql/src/backend/executor/nodeSetOp.c,v 1.18 2005/10/15 02:49:17 momjian Exp $
24+
* $PostgreSQL: pgsql/src/backend/executor/nodeSetOp.c,v 1.19 2005/11/23 20:27:57 tgl Exp $
2525
*
2626
*-------------------------------------------------------------------------
2727
*/
@@ -258,7 +258,7 @@ ExecInitSetOp(SetOp *node, EState *estate)
258258
* setop nodes do no projections, so initialize projection info for this
259259
* node appropriately
260260
*/
261-
ExecAssignResultTypeFromOuterPlan(&setopstate->ps);
261+
ExecAssignResultTypeFromTL(&setopstate->ps);
262262
setopstate->ps.ps_ProjInfo=NULL;
263263

264264
/*

‎src/backend/executor/nodeSort.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.51 2005/10/15 02:49:17 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.52 2005/11/23 20:27:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -193,7 +193,7 @@ ExecInitSort(Sort *node, EState *estate)
193193
* initialize tuple type. no need to initialize projection info because
194194
* this node doesn't do projections.
195195
*/
196-
ExecAssignResultTypeFromOuterPlan(&sortstate->ss.ps);
196+
ExecAssignResultTypeFromTL(&sortstate->ss.ps);
197197
ExecAssignScanTypeFromOuterPlan(&sortstate->ss);
198198
sortstate->ss.ps.ps_ProjInfo=NULL;
199199

‎src/backend/executor/nodeUnique.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeUnique.c,v 1.49 2005/11/22 18:17:10 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeUnique.c,v 1.50 2005/11/23 20:27:57 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -150,7 +150,7 @@ ExecInitUnique(Unique *node, EState *estate)
150150
* unique nodes do no projections, so initialize projection info for this
151151
* node appropriately
152152
*/
153-
ExecAssignResultTypeFromOuterPlan(&uniquestate->ps);
153+
ExecAssignResultTypeFromTL(&uniquestate->ps);
154154
uniquestate->ps.ps_ProjInfo=NULL;
155155

156156
/*

‎src/include/executor/executor.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.120 2005/10/15 02:49:44 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.121 2005/11/23 20:27:58 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -218,7 +218,6 @@ extern ExprContext *MakePerTupleExprContext(EState *estate);
218218
externvoidExecAssignExprContext(EState*estate,PlanState*planstate);
219219
externvoidExecAssignResultType(PlanState*planstate,
220220
TupleDesctupDesc,boolshouldFree);
221-
externvoidExecAssignResultTypeFromOuterPlan(PlanState*planstate);
222221
externvoidExecAssignResultTypeFromTL(PlanState*planstate);
223222
externTupleDescExecGetResultType(PlanState*planstate);
224223
externProjectionInfo*ExecBuildProjectionInfo(List*targetList,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp