aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAppend.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-10-30 23:13:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-10-30 23:13:30 +0000
commit5b9d655ba7823cf52fcae1038ec48c347c39029f (patch)
treece91eb497ec248920df1ca194cb9d68afc398aeb /src/backend/executor/nodeAppend.c
parent4ce4d7f7d321979c38c2d9177eac634f92da6070 (diff)
downloadpostgresql-5b9d655ba7823cf52fcae1038ec48c347c39029f.tar.gz
postgresql-5b9d655ba7823cf52fcae1038ec48c347c39029f.zip
Avoid duplicate ExecTypeFromTL() call in ExecInitJunkFilter() by passing
in the TupleDesc that the caller already has (for call from ExecMain) or can make just as easily as ExecInitJunkFilter() can (for call from ExecAppend). Also, don't bother to build a junk filter for an INSERT operation that doesn't actually need one, which is the normal case.
Diffstat (limited to 'src/backend/executor/nodeAppend.c')
-rw-r--r--src/backend/executor/nodeAppend.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c
index f20d9c56bc6..e04113149fa 100644
--- a/src/backend/executor/nodeAppend.c
+++ b/src/backend/executor/nodeAppend.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.26 1999/09/24 00:24:23 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.27 1999/10/30 23:13:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -276,9 +276,6 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
for (i = 0; i < nplans; i++)
{
- JunkFilter *j;
- List *targetList;
-
/* ----------------
* NOTE: we first modify range table in
* exec_append_initialize_next() and
@@ -302,9 +299,8 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
if ((es_rri != (RelationInfo *) NULL) &&
(node->inheritrelid == es_rri->ri_RangeTableIndex))
{
-
- targetList = initNode->targetlist;
- j = (JunkFilter *) ExecInitJunkFilter(targetList);
+ JunkFilter *j = ExecInitJunkFilter(initNode->targetlist,
+ ExecGetTupType(initNode));
junkList = lappend(junkList, j);
}
@@ -318,9 +314,7 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
* ----------------
*/
initNode = (Plan *) nth(0, appendplans);
- ExecAssignResultType(&appendstate->cstate,
-/* ExecGetExecTupDesc(initNode), */
- ExecGetTupType(initNode));
+ ExecAssignResultType(&appendstate->cstate, ExecGetTupType(initNode));
appendstate->cstate.cs_ProjInfo = NULL;
/* ----------------
@@ -329,9 +323,7 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent)
*/
appendstate->as_whichplan = 0;
exec_append_initialize_next(node);
-#ifdef NOT_USED
- result = (List *) initialized[0];
-#endif
+
return TRUE;
}