1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +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:
Tom Lane
2002-12-12 15:49:42 +00:00
parent debb072886
commit a0bf885f9e
69 changed files with 3390 additions and 3433 deletions

View File

@ -8,12 +8,10 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.19 2002/09/02 02:47:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.20 2002/12/12 15:49:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "nodes/nodeFuncs.h"
@ -21,6 +19,7 @@
static bool var_is_inner(Var *var);
/*
* single_node -
* Returns t if node corresponds to a single-noded expression
@ -79,41 +78,15 @@ var_is_rel(Var *var)
*****************************************************************************/
/*
* replace_opid -
*
* Given a oper node, resets the opfid field with the
* procedure OID (regproc id).
*
* Returns the modified oper node.
* set_opfuncid -
*
* Set the opfuncid (procedure OID) in an OpExpr node,
* if it hasn't been set already.
*/
Oper *
replace_opid(Oper *oper)
void
set_opfuncid(OpExpr *opexpr)
{
oper->opid = get_opcode(oper->opno);
oper->op_fcache = NULL;
return oper;
if (opexpr->opfuncid == InvalidOid)
opexpr->opfuncid = get_opcode(opexpr->opno);
opexpr->op_fcache = NULL; /* XXX will go away soon */
}
/*****************************************************************************
* constant (CONST, PARAM) nodes
*****************************************************************************/
#ifdef NOT_USED
/*
* non_null -
* Returns t if the node is a non-null constant, e.g., if the node has a
* valid `constvalue' field.
*/
bool
non_null(Expr *c)
{
if (IsA(c, Const) &&
!((Const *) c)->constisnull)
return true;
else
return false;
}
#endif