* different executor state node types.
*
*
- * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.180 2002/04/18 20:01:09 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.192 2002/07/01 15:27:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return newnode;
}
+/* ----------------
+ * _copyFunctionScan
+ * ----------------
+ */
+static FunctionScan *
+_copyFunctionScan(FunctionScan *from)
+{
+ FunctionScan *newnode = makeNode(FunctionScan);
+
+ /*
+ * copy node superclass fields
+ */
+ CopyPlanFields((Plan *) from, (Plan *) newnode);
+ CopyScanFields((Scan *) from, (Scan *) newnode);
+
+ return newnode;
+}
/* ----------------
* CopyJoinFields
{
newnode->jointype = from->jointype;
Node_Copy(from, newnode, joinqual);
- newnode->joinrti = from->joinrti;
/* subPlan list must point to subplans in the new subtree, not the old */
if (from->plan.subPlan != NIL)
newnode->plan.subPlan = nconc(newnode->plan.subPlan,
newnode->opno = from->opno;
newnode->opid = from->opid;
newnode->opresulttype = from->opresulttype;
+ newnode->opretset = from->opretset;
/* Do not copy the run-time state, if any */
newnode->op_fcache = NULL;
* copy remainder of node
*/
newnode->funcid = from->funcid;
- newnode->functype = from->functype;
+ newnode->funcresulttype = from->funcresulttype;
+ newnode->funcretset = from->funcretset;
/* Do not copy the run-time state, if any */
newnode->func_fcache = NULL;
Node_Copy(from, newnode, cheapest_total_path);
newnode->pruneable = from->pruneable;
- newnode->issubquery = from->issubquery;
+ newnode->rtekind = from->rtekind;
Node_Copy(from, newnode, indexlist);
newnode->pages = from->pages;
newnode->tuples = from->tuples;
return newnode;
}
-static Iter *
-_copyIter(Iter *from)
-{
- Iter *newnode = makeNode(Iter);
-
- Node_Copy(from, newnode, iterexpr);
- newnode->itertype = from->itertype;
-
- return newnode;
-}
-
static Stream *
_copyStream(Stream *from)
{
newnode->rtekind = from->rtekind;
newnode->relid = from->relid;
Node_Copy(from, newnode, subquery);
+ Node_Copy(from, newnode, funcexpr);
newnode->jointype = from->jointype;
- newnode->joincoltypes = listCopy(from->joincoltypes);
- newnode->joincoltypmods = listCopy(from->joincoltypmods);
- newnode->joinleftcols = listCopy(from->joinleftcols);
- newnode->joinrightcols = listCopy(from->joinrightcols);
+ Node_Copy(from, newnode, joinaliasvars);
Node_Copy(from, newnode, alias);
Node_Copy(from, newnode, eref);
newnode->inh = from->inh;
return newnode;
}
+static RangeFunction *
+_copyRangeFunction(RangeFunction *from)
+{
+ RangeFunction *newnode = makeNode(RangeFunction);
+
+ Node_Copy(from, newnode, funccallnode);
+ Node_Copy(from, newnode, alias);
+
+ return newnode;
+}
+
static TypeCast *
_copyTypeCast(TypeCast *from)
{
{
CopyStmt *newnode = makeNode(CopyStmt);
- newnode->binary = from->binary;
Node_Copy(from, newnode, relation);
- newnode->oids = from->oids;
- newnode->direction = from->direction;
+ newnode->is_from = from->is_from;
if (from->filename)
newnode->filename = pstrdup(from->filename);
- if (from->delimiter)
- newnode->delimiter = pstrdup(from->delimiter);
- if (from->null_print)
- newnode->null_print = pstrdup(from->null_print);
+ Node_Copy(from, newnode, options);
return newnode;
}
return newnode;
}
-static ProcedureStmt *
-_copyProcedureStmt(ProcedureStmt *from)
+static CreateFunctionStmt *
+_copyCreateFunctionStmt(CreateFunctionStmt *from)
{
- ProcedureStmt *newnode = makeNode(ProcedureStmt);
+ CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
newnode->replace = from->replace;
Node_Copy(from, newnode, funcname);
Node_Copy(from, newnode, argTypes);
Node_Copy(from, newnode, returnType);
+ Node_Copy(from, newnode, options);
Node_Copy(from, newnode, withClause);
- Node_Copy(from, newnode, as);
- newnode->language = pstrdup(from->language);
return newnode;
}
Node_Copy(from, newnode, aggname);
Node_Copy(from, newnode, aggtype);
+ newnode->behavior = from->behavior;
return newnode;
}
Node_Copy(from, newnode, funcname);
Node_Copy(from, newnode, args);
+ newnode->behavior = from->behavior;
return newnode;
}
Node_Copy(from, newnode, opname);
Node_Copy(from, newnode, args);
+ newnode->behavior = from->behavior;
return newnode;
}
RenameStmt *newnode = makeNode(RenameStmt);
Node_Copy(from, newnode, relation);
- if (from->column)
- newnode->column = pstrdup(from->column);
+ if (from->oldname)
+ newnode->oldname = pstrdup(from->oldname);
if (from->newname)
newnode->newname = pstrdup(from->newname);
+ newnode->renameType = from->renameType;
return newnode;
}
if (from->dbname)
newnode->dbname = pstrdup(from->dbname);
- if (from->dbowner)
- newnode->dbowner = pstrdup(from->dbowner);
- if (from->dbpath)
- newnode->dbpath = pstrdup(from->dbpath);
- if (from->dbtemplate)
- newnode->dbtemplate = pstrdup(from->dbtemplate);
- newnode->encoding = from->encoding;
+ Node_Copy(from, newnode, options);
return newnode;
}
if (from->name)
newnode->name = pstrdup(from->name);
Node_Copy(from, newnode, args);
+ newnode->is_local = from->is_local;
return newnode;
}
if (from->property)
newnode->property = pstrdup(from->property);
newnode->removeType = from->removeType;
+ newnode->behavior = from->behavior;
return newnode;
}
if (from->plname)
newnode->plname = pstrdup(from->plname);
Node_Copy(from, newnode, plhandler);
+ Node_Copy(from, newnode, plvalidator);
if (from->plcompiler)
newnode->plcompiler = pstrdup(from->plcompiler);
newnode->pltrusted = from->pltrusted;
if (from->plname)
newnode->plname = pstrdup(from->plname);
+ newnode->behavior = from->behavior;
return newnode;
}
if (from->user)
newnode->user = pstrdup(from->user);
if (from->variable)
- newnode->user = pstrdup(from->variable);
+ newnode->variable = pstrdup(from->variable);
Node_Copy(from, newnode, value);
return newnode;
case T_SubqueryScan:
retval = _copySubqueryScan(from);
break;
+ case T_FunctionScan:
+ retval = _copyFunctionScan(from);
+ break;
case T_Join:
retval = _copyJoin(from);
break;
case T_ArrayRef:
retval = _copyArrayRef(from);
break;
- case T_Iter:
- retval = _copyIter(from);
- break;
case T_FieldSelect:
retval = _copyFieldSelect(from);
break;
case T_IndexStmt:
retval = _copyIndexStmt(from);
break;
- case T_ProcedureStmt:
- retval = _copyProcedureStmt(from);
+ case T_CreateFunctionStmt:
+ retval = _copyCreateFunctionStmt(from);
break;
case T_RemoveAggrStmt:
retval = _copyRemoveAggrStmt(from);
case T_RangeSubselect:
retval = _copyRangeSubselect(from);
break;
+ case T_RangeFunction:
+ retval = _copyRangeFunction(from);
+ break;
case T_TypeName:
retval = _copyTypeName(from);
break;