📄 nodefuncs.c
字号:
/*------------------------------------------------------------------------- * * nodeFuncs.c * All node routines more complicated than simple access/modification * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $Header: /usr/local/cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.9 1999/02/13 23:15:59 momjian Exp $ * *------------------------------------------------------------------------- */#include <sys/types.h>#include "postgres.h"#include "nodes/primnodes.h"#include "nodes/plannodes.h"#include "nodes/pg_list.h"#include "nodes/relation.h"#include "nodes/nodeFuncs.h"#include "utils/lsyscache.h"static bool var_is_inner(Var *var);/* * single_node - * Returns t if node corresponds to a single-noded expression */boolsingle_node(Node *node){ if (IsA(node, Ident) ||IsA(node, Const) ||IsA(node, Var) ||IsA(node, Param)) return true; else return false;}/***************************************************************************** * VAR nodes *****************************************************************************//* * var_is_outer * var_is_inner * var_is_mat * var_is_rel * * Returns t iff the var node corresponds to (respectively): * the outer relation in a join * the inner relation of a join * a materialized relation * a base relation (i.e., not an attribute reference, a variable from * some lower join level, or a sort result) * var node is an array reference * */boolvar_is_outer(Var *var){ return (bool) (var->varno == OUTER);}static boolvar_is_inner(Var *var){ return (bool) (var->varno == INNER);}boolvar_is_rel(Var *var){ return (bool) !(var_is_inner(var) || var_is_outer(var));}/***************************************************************************** * OPER nodes *****************************************************************************//* * replace_opid - * * Given a oper node, resets the opfid field with the * procedure OID (regproc id). * * Returns the modified oper node. * */Oper *replace_opid(Oper *oper){ oper->opid = get_opcode(oper->opno); oper->op_fcache = NULL; return oper;}/***************************************************************************** * constant (CONST, PARAM) nodes *****************************************************************************//* * non_null - * Returns t if the node is a non-null constant, e.g., if the node has a * valid `constvalue' field. * */boolnon_null(Expr *c){ if (IsA(c, Const) &&!((Const *) c)->constisnull) return true; else return false;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -