aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 5fff2f762ab..0438e0ce609 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.214 2002/10/14 22:14:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.215 2002/11/06 00:00:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -497,10 +497,10 @@ _copyGroup(Group *from)
CopyPlanFields((Plan *) from, (Plan *) newnode);
- newnode->tuplePerGroup = from->tuplePerGroup;
newnode->numCols = from->numCols;
newnode->grpColIdx = palloc(from->numCols * sizeof(AttrNumber));
- memcpy(newnode->grpColIdx, from->grpColIdx, from->numCols * sizeof(AttrNumber));
+ memcpy(newnode->grpColIdx, from->grpColIdx,
+ from->numCols * sizeof(AttrNumber));
return newnode;
}
@@ -516,6 +516,15 @@ _copyAgg(Agg *from)
CopyPlanFields((Plan *) from, (Plan *) newnode);
+ newnode->aggstrategy = from->aggstrategy;
+ newnode->numCols = from->numCols;
+ if (from->numCols > 0)
+ {
+ newnode->grpColIdx = palloc(from->numCols * sizeof(AttrNumber));
+ memcpy(newnode->grpColIdx, from->grpColIdx,
+ from->numCols * sizeof(AttrNumber));
+ }
+
return newnode;
}
@@ -1281,6 +1290,29 @@ _copyAppendPath(AppendPath *from)
}
/* ----------------
+ * _copyResultPath
+ * ----------------
+ */
+static ResultPath *
+_copyResultPath(ResultPath *from)
+{
+ ResultPath *newnode = makeNode(ResultPath);
+
+ /*
+ * copy the node superclass fields
+ */
+ CopyPathFields((Path *) from, (Path *) newnode);
+
+ /*
+ * copy remainder of node
+ */
+ Node_Copy(from, newnode, subpath);
+ Node_Copy(from, newnode, constantqual);
+
+ return newnode;
+}
+
+/* ----------------
* CopyJoinPathFields
*
* This function copies the fields of the JoinPath node. It is used by
@@ -2878,6 +2910,9 @@ copyObject(void *from)
case T_AppendPath:
retval = _copyAppendPath(from);
break;
+ case T_ResultPath:
+ retval = _copyResultPath(from);
+ break;
case T_NestPath:
retval = _copyNestPath(from);
break;