*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.21 1998/06/15 19:28:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.22 1998/07/15 22:16:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
ExecReScanMergeJoin((MergeJoin *) node, exprCtxt, parent);
break;
+ case T_Append:
+ ExecReScanAppend((Append *) node, exprCtxt, parent);
+ break;
+
/*
* Tee is never used
case T_Tee:
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.13 1998/07/15 14:54:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.14 1998/07/15 22:16:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ExecInitAppend - initialize the append node
* ExecProcAppend - retrieve the next tuple from the node
* ExecEndAppend - shut down the append node
+ * ExecReScanAppend - rescan the append node
*
* NOTES
* Each append node contains a list of one or more subplans which
* nil nil ... ... ...
* subplans
*
- * Append nodes are currently used to unions, and to support inheritance
+ * Append nodes are currently used for unions, and to support inheritance
* queries, where several relations need to be scanned.
* For example, in our standard person/student/employee/student-emp
* example, where student and employee inherit from person
* appendstate->as_junkfilter_list here
*/
}
+void
+ExecReScanAppend(Append *node, ExprContext *exprCtxt, Plan *parent)
+{
+ AppendState *appendstate = node->appendstate;
+ int nplans = length(node->appendplans);
+ int i;
+
+ for (i = 0; i < nplans; i++)
+ {
+ Plan *rescanNode;
+
+ appendstate->as_whichplan = i;
+ rescanNode = (Plan *) nth(i, node->appendplans);
+ if (rescanNode->chgParam == NULL)
+ {
+ exec_append_initialize_next(node);
+ ExecReScan((Plan *)rescanNode, exprCtxt, (Plan *) node);
+ }
+ }
+ appendstate->as_whichplan = 0;
+ exec_append_initialize_next(node);
+}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeAppend.h,v 1.7 1997/11/26 01:12:44 momjian Exp $
+ * $Id: nodeAppend.h,v 1.8 1998/07/15 22:16:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern int ExecCountSlotsAppend(Append *node);
extern TupleTableSlot *ExecProcAppend(Append *node);
extern void ExecEndAppend(Append *node);
+extern void ExecReScanAppend(Append *node, ExprContext *exprCtxt, Plan *parent);
#endif /* NODEAPPEND_H */