summaryrefslogtreecommitdiff
path: root/src/backend/executor/execJunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/execJunk.c')
-rw-r--r--src/backend/executor/execJunk.c52
1 files changed, 6 insertions, 46 deletions
diff --git a/src/backend/executor/execJunk.c b/src/backend/executor/execJunk.c
index 970e1c325e3..9741897e838 100644
--- a/src/backend/executor/execJunk.c
+++ b/src/backend/executor/execJunk.c
@@ -59,7 +59,10 @@
JunkFilter *
ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
{
+ JunkFilter *junkfilter;
TupleDesc cleanTupType;
+ int cleanLength;
+ AttrNumber *cleanMap;
/*
* Compute the tuple descriptor for the cleaned tuple.
@@ -67,36 +70,6 @@ ExecInitJunkFilter(List *targetList, TupleTableSlot *slot)
cleanTupType = ExecCleanTypeFromTL(targetList);
/*
- * The rest is the same as ExecInitJunkFilterInsertion, ie, we want to map
- * every non-junk targetlist column into the output tuple.
- */
- return ExecInitJunkFilterInsertion(targetList, cleanTupType, slot);
-}
-
-/*
- * ExecInitJunkFilterInsertion
- *
- * Initialize a JunkFilter for insertions into a table.
- *
- * Here, we are given the target "clean" tuple descriptor rather than
- * inferring it from the targetlist. Although the target descriptor can
- * contain deleted columns, that is not of concern here, since the targetlist
- * should contain corresponding NULL constants (cf. ExecCheckPlanOutput).
- * It is assumed that the caller has checked that the table's columns match up
- * with the non-junk columns of the targetlist.
- */
-JunkFilter *
-ExecInitJunkFilterInsertion(List *targetList,
- TupleDesc cleanTupType,
- TupleTableSlot *slot)
-{
- JunkFilter *junkfilter;
- int cleanLength;
- AttrNumber *cleanMap;
- ListCell *t;
- AttrNumber cleanResno;
-
- /*
* Use the given slot, or make a new slot if we weren't given one.
*/
if (slot)
@@ -117,6 +90,9 @@ ExecInitJunkFilterInsertion(List *targetList,
cleanLength = cleanTupType->natts;
if (cleanLength > 0)
{
+ AttrNumber cleanResno;
+ ListCell *t;
+
cleanMap = (AttrNumber *) palloc(cleanLength * sizeof(AttrNumber));
cleanResno = 0;
foreach(t, targetList)
@@ -263,22 +239,6 @@ ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName)
}
/*
- * ExecGetJunkAttribute
- *
- * Given a junk filter's input tuple (slot) and a junk attribute's number
- * previously found by ExecFindJunkAttribute, extract & return the value and
- * isNull flag of the attribute.
- */
-Datum
-ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno,
- bool *isNull)
-{
- Assert(attno > 0);
-
- return slot_getattr(slot, attno, isNull);
-}
-
-/*
* ExecFilterJunk
*
* Construct and return a slot with all the junk attributes removed.