mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user