aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_func.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-12-12 15:49:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-12-12 15:49:42 +0000
commita0bf885f9eaccadd23b766ecbc064f17f06ae883 (patch)
tree62b65e5cf1a8ec02ece3a98c15457ddff018bb94 /src/backend/parser/parse_func.c
parentdebb072886efcb15e7f0825e35b168afe316d37d (diff)
downloadpostgresql-a0bf885f9eaccadd23b766ecbc064f17f06ae883.tar.gz
postgresql-a0bf885f9eaccadd23b766ecbc064f17f06ae883.zip
Phase 2 of read-only-plans project: restructure expression-tree nodes
so that all executable expression nodes inherit from a common supertype Expr. This is somewhat of an exercise in code purity rather than any real functional advance, but getting rid of the extra Oper or Func node formerly used in each operator or function call should provide at least a little space and speed improvement. initdb forced by changes in stored-rules representation.
Diffstat (limited to 'src/backend/parser/parse_func.c')
-rw-r--r--src/backend/parser/parse_func.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 46d1bb0755c..4a2eb27d7cc 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.142 2002/11/13 00:39:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.143 2002/12/12 15:49:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -315,21 +315,15 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
/* build the appropriate output structure */
if (fdresult == FUNCDETAIL_NORMAL)
{
- Expr *expr = makeNode(Expr);
- Func *funcnode = makeNode(Func);
+ FuncExpr *funcexpr = makeNode(FuncExpr);
- funcnode->funcid = funcid;
- funcnode->funcresulttype = rettype;
- funcnode->funcretset = retset;
- funcnode->funcformat = COERCE_EXPLICIT_CALL;
- funcnode->func_fcache = NULL;
+ funcexpr->funcid = funcid;
+ funcexpr->funcresulttype = rettype;
+ funcexpr->funcretset = retset;
+ funcexpr->funcformat = COERCE_EXPLICIT_CALL;
+ funcexpr->args = fargs;
- expr->typeOid = rettype;
- expr->opType = FUNC_EXPR;
- expr->oper = (Node *) funcnode;
- expr->args = fargs;
-
- retval = (Node *) expr;
+ retval = (Node *) funcexpr;
}
else
{
@@ -1182,7 +1176,7 @@ setup_field_select(Node *input, char *attname, Oid relid)
elog(ERROR, "Relation \"%s\" has no column \"%s\"",
get_rel_name(relid), attname);
- fselect->arg = input;
+ fselect->arg = (Expr *) input;
fselect->fieldnum = attno;
fselect->resulttype = get_atttype(relid, attno);
fselect->resulttypmod = get_atttypmod(relid, attno);