mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +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:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.113 2002/10/20 00:58:55 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.114 2002/12/12 15:49:40 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -304,7 +304,7 @@ rewriteTargetList(Query *parsetree, Relation target_relation)
|
||||
att_tup->atttypmod,
|
||||
pstrdup(NameStr(att_tup->attname)),
|
||||
false),
|
||||
new_expr);
|
||||
(Expr *) new_expr);
|
||||
}
|
||||
|
||||
if (new_tle)
|
||||
@ -389,10 +389,10 @@ process_matched_tle(TargetEntry *src_tle,
|
||||
* Prior TLE could be a nest of ArrayRefs if we do this more than
|
||||
* once.
|
||||
*/
|
||||
priorbottom = ((ArrayRef *) prior_tle->expr)->refexpr;
|
||||
priorbottom = (Node *) ((ArrayRef *) prior_tle->expr)->refexpr;
|
||||
while (priorbottom != NULL && IsA(priorbottom, ArrayRef) &&
|
||||
((ArrayRef *) priorbottom)->refassgnexpr != NULL)
|
||||
priorbottom = ((ArrayRef *) priorbottom)->refexpr;
|
||||
priorbottom = (Node *) ((ArrayRef *) priorbottom)->refexpr;
|
||||
if (!equal(priorbottom, ((ArrayRef *) src_tle->expr)->refexpr))
|
||||
elog(ERROR, "Multiple assignments to same attribute \"%s\"",
|
||||
resdom->resname);
|
||||
@ -404,7 +404,7 @@ process_matched_tle(TargetEntry *src_tle,
|
||||
memcpy(newexpr, src_tle->expr, sizeof(ArrayRef));
|
||||
newexpr->refexpr = prior_tle->expr;
|
||||
|
||||
return makeTargetEntry(resdom, (Node *) newexpr);
|
||||
return makeTargetEntry(resdom, (Expr *) newexpr);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user