From a0bf885f9eaccadd23b766ecbc064f17f06ae883 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 12 Dec 2002 15:49:42 +0000 Subject: 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. --- src/backend/parser/parse_clause.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/backend/parser/parse_clause.c') diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index ca398b4e3b3..6f05ee329cd 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.100 2002/11/29 21:39:11 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.101 2002/12/12 15:49:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -502,17 +502,6 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r) elog(ERROR, "cannot use aggregate function in FROM function expression"); } - /* - * Insist we have a bare function call (explain.c is the only place - * that depends on this, I think). If this fails, it's probably - * because transformExpr interpreted the function notation as a type - * coercion. - */ - if (!funcexpr || - !IsA(funcexpr, Expr) || - ((Expr *) funcexpr)->opType != FUNC_EXPR) - elog(ERROR, "Coercion function not allowed in FROM clause"); - /* * OK, build an RTE for the function. */ @@ -876,7 +865,7 @@ buildMergedJoinVar(JoinType jointype, Var *l_colvar, Var *r_colvar) outcoltype, COERCION_IMPLICIT, COERCE_IMPLICIT_CAST); else if (l_colvar->vartypmod != outcoltypmod) - l_node = (Node *) makeRelabelType((Node *) l_colvar, + l_node = (Node *) makeRelabelType((Expr *) l_colvar, outcoltype, outcoltypmod, COERCE_IMPLICIT_CAST); else @@ -887,7 +876,7 @@ buildMergedJoinVar(JoinType jointype, Var *l_colvar, Var *r_colvar) outcoltype, COERCION_IMPLICIT, COERCE_IMPLICIT_CAST); else if (r_colvar->vartypmod != outcoltypmod) - r_node = (Node *) makeRelabelType((Node *) r_colvar, + r_node = (Node *) makeRelabelType((Expr *) r_colvar, outcoltype, outcoltypmod, COERCE_IMPLICIT_CAST); else @@ -928,13 +917,13 @@ buildMergedJoinVar(JoinType jointype, Var *l_colvar, Var *r_colvar) CaseWhen *w = makeNode(CaseWhen); NullTest *n = makeNode(NullTest); - n->arg = l_node; + n->arg = (Expr *) l_node; n->nulltesttype = IS_NOT_NULL; - w->expr = (Node *) n; - w->result = l_node; + w->expr = (Expr *) n; + w->result = (Expr *) l_node; c->casetype = outcoltype; c->args = makeList1(w); - c->defresult = r_node; + c->defresult = (Expr *) r_node; res_node = (Node *) c; break; } -- cgit v1.2.3