aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-08-08 15:43:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-08-08 15:43:12 +0000
commit62e29fe2e748933bfd8ab1429518ee7b5a8974a7 (patch)
treed9ca32ad908a811854e890c059b46b8ff13fa038 /src/backend/nodes/copyfuncs.c
parent8fc32374beb542380857e2fc0d67df91ad123b1d (diff)
downloadpostgresql-62e29fe2e748933bfd8ab1429518ee7b5a8974a7.tar.gz
postgresql-62e29fe2e748933bfd8ab1429518ee7b5a8974a7.zip
Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'
from Param nodes, per discussion a few days ago on pghackers. Add new expression node type FieldSelect that implements the functionality where it's actually needed. Clean up some other unused fields in Func nodes as well. NOTE: initdb forced due to change in stored expression trees for rules.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 2def370e9fb..33b630c7934 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -19,7 +19,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.118 2000/07/22 04:22:46 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.119 2000/08/08 15:41:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -717,14 +717,8 @@ _copyOper(Oper *from)
newnode->opno = from->opno;
newnode->opid = from->opid;
newnode->opresulttype = from->opresulttype;
- newnode->opsize = from->opsize;
-
- /*
- * NOTE: shall we copy the cache structure or just the pointer ?
- * Alternatively we can set 'op_fcache' to NULL, in which case the
- * executor will initialize it when it needs it...
- */
- newnode->op_fcache = from->op_fcache;
+ /* Do not copy the run-time state, if any */
+ newnode->op_fcache = NULL;
return newnode;
}
@@ -797,7 +791,6 @@ _copyParam(Param *from)
if (from->paramname != NULL)
newnode->paramname = pstrdup(from->paramname);
newnode->paramtype = from->paramtype;
- Node_Copy(from, newnode, param_tlist);
return newnode;
}
@@ -817,11 +810,8 @@ _copyFunc(Func *from)
*/
newnode->funcid = from->funcid;
newnode->functype = from->functype;
- newnode->funcisindex = from->funcisindex;
- newnode->funcsize = from->funcsize;
- newnode->func_fcache = from->func_fcache;
- Node_Copy(from, newnode, func_tlist);
- Node_Copy(from, newnode, func_planlist);
+ /* Do not copy the run-time state, if any */
+ newnode->func_fcache = NULL;
return newnode;
}
@@ -873,6 +863,27 @@ _copySubLink(SubLink *from)
}
/* ----------------
+ * _copyFieldSelect
+ * ----------------
+ */
+static FieldSelect *
+_copyFieldSelect(FieldSelect *from)
+{
+ FieldSelect *newnode = makeNode(FieldSelect);
+
+ /* ----------------
+ * copy remainder of node
+ * ----------------
+ */
+ Node_Copy(from, newnode, arg);
+ newnode->fieldnum = from->fieldnum;
+ newnode->resulttype = from->resulttype;
+ newnode->resulttypmod = from->resulttypmod;
+
+ return newnode;
+}
+
+/* ----------------
* _copyRelabelType
* ----------------
*/
@@ -1710,6 +1721,9 @@ copyObject(void *from)
case T_Iter:
retval = _copyIter(from);
break;
+ case T_FieldSelect:
+ retval = _copyFieldSelect(from);
+ break;
case T_RelabelType:
retval = _copyRelabelType(from);
break;