From 62e29fe2e748933bfd8ab1429518ee7b5a8974a7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 8 Aug 2000 15:43:12 +0000 Subject: 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. --- src/backend/nodes/copyfuncs.c | 44 ++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'src/backend/nodes/copyfuncs.c') diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 2def370e9f..33b630c793 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; } @@ -872,6 +862,27 @@ _copySubLink(SubLink *from) return newnode; } +/* ---------------- + * _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; -- cgit v1.2.1