PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/nbtree.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "executor/execExpr.h"
#include "executor/nodeSubplan.h"
#include "funcapi.h"
#include "jit/jit.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "nodes/subscripting.h"
#include "optimizer/optimizer.h"
#include "pgstat.h"
#include "utils/acl.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/jsonfuncs.h"
#include "utils/jsonpath.h"
#include "utils/lsyscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
struct | ExprSetupInfo |
Typedefs | |
typedef struct ExprSetupInfo | ExprSetupInfo |
typedef struct ExprSetupInfo ExprSetupInfo |
ExprState * ExecBuildAggTrans | ( | AggState * | aggstate, |
AggStatePerPhase | phase, | ||
bool | doSort, | ||
bool | doHash, | ||
bool | nullcheck | ||
) |
Definition at line 3669 of file execExpr.c.
References ExprEvalStep::agg_deserialize, AGG_HASHED, ExprEvalStep::agg_presorted_distinctcheck, ExprEvalStep::agg_strict_input_check, Aggref::aggdirectargs, Aggref::aggdistinct, Aggref::aggfilter, Aggref::aggorder, AggStatePerTransData::aggref, AggStatePerTransData::aggsortrequired, AggState::aggsplit, AggState::aggstrategy, arg, ExprEvalStep::args, FunctionCallInfoBaseData::args, Aggref::args, Assert, bail, ExprEvalStep::d, AggStatePerTransData::deserialfn, AggStatePerTransData::deserialfn_fcinfo, AggStatePerTransData::deserialfn_oid, DO_AGGSPLIT_COMBINE, EEOP_AGG_DESERIALIZE, EEOP_AGG_PRESORTED_DISTINCT_MULTI, EEOP_AGG_PRESORTED_DISTINCT_SINGLE, EEOP_AGG_STRICT_DESERIALIZE, EEOP_AGG_STRICT_INPUT_CHECK_ARGS, EEOP_AGG_STRICT_INPUT_CHECK_NULLS, EEOP_DONE, EEOP_JUMP_IF_NOT_TRUE, ExecBuildAggTransCall(), ExecInitExprRec(), ExecPushExprSetupSteps(), ExecReadyExpr(), TargetEntry::expr, expr_setup_walker(), ExprEvalPushStep(), ExprEvalStep::fcinfo_data, FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_strict, NullableDatum::isnull, ExprEvalStep::jump, ExprEvalStep::jumpdistinct, ExprEvalStep::jumpdone, ExprEvalStep::jumpnull, lappend_int(), lfirst, lfirst_int, linitial, list_length(), makeNode, Max, AggState::maxsets, ExprEvalStep::nargs, NIL, ExprEvalStep::nulls, AggState::num_hashes, AggStatePerTransData::numDistinctCols, AggStatePerTransData::numInputs, AggStatePerPhaseData::numsets, AggStatePerTransData::numSortCols, AggState::numtrans, AggStatePerTransData::numTransInputs, OidIsValid, ExprEvalStep::opcode, ExprEvalStep::pertrans, AggState::pertrans, PointerGetDatum(), ScanState::ps, ExprEvalStep::resnull, ExprEvalStep::resvalue, AggStatePerTransData::sortslot, AggState::ss, AggStatePerTransData::transfn_fcinfo, TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, NullableDatum::value, and values.
Referenced by ExecInitAgg(), and hashagg_recompile_expressions().
|
static |
Definition at line 4008 of file execExpr.c.
References ExprEvalStep::agg_plain_pergroup_nullcheck, ExprEvalStep::agg_trans, ExprEvalStep::aggcontext, AggState::aggcontexts, AggStatePerTransData::aggsortrequired, Assert, ExprEvalStep::d, EEOP_AGG_ORDERED_TRANS_DATUM, EEOP_AGG_ORDERED_TRANS_TUPLE, EEOP_AGG_PLAIN_PERGROUP_NULLCHECK, EEOP_AGG_PLAIN_TRANS_BYREF, EEOP_AGG_PLAIN_TRANS_BYVAL, EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF, EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL, EEOP_AGG_PLAIN_TRANS_STRICT_BYREF, EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL, ExprEvalPushStep(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_strict, AggState::hashcontext, AggStatePerTransData::initValueIsNull, ExprEvalStep::jumpnull, AggStatePerTransData::numInputs, ExprEvalStep::opcode, ExprEvalStep::pertrans, ExprEvalStep::setno, ExprEvalStep::setoff, ExprEvalStep::transno, and AggStatePerTransData::transtypeByVal.
Referenced by ExecBuildAggTrans().
ExprState * ExecBuildGroupingEqual | ( | TupleDesc | ldesc, |
TupleDesc | rdesc, | ||
const TupleTableSlotOps * | lops, | ||
const TupleTableSlotOps * | rops, | ||
int | numCols, | ||
const AttrNumber * | keyColIdx, | ||
const Oid * | eqfunctions, | ||
const Oid * | collations, | ||
PlanState * | parent | ||
) |
Definition at line 4454 of file execExpr.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, FunctionCallInfoBaseData::args, Assert, ExprEvalStep::attnum, collid, ExprEvalStep::d, EEO_FLAG_IS_QUAL, EEOP_DONE, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, EEOP_NOT_DISTINCT, EEOP_OUTER_FETCHSOME, EEOP_OUTER_VAR, EEOP_QUAL, ExecComputeSlotInfo(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fcinfo_data, ExprEvalStep::fetch, ExprEvalStep::finfo, ExprEvalStep::fixed, fmgr_info(), fmgr_info_set_expr, ExprEvalStep::fn_addr, FmgrInfo::fn_addr, ExprEvalStep::func, get_func_name(), GetUserId(), InitFunctionCallInfoData, InvokeFunctionExecuteHook, NullableDatum::isnull, ExprEvalStep::jumpdone, ExprEvalStep::kind, ExprEvalStep::known_desc, lappend_int(), ExprEvalStep::last_var, lfirst_int, makeNode, ExprEvalStep::nargs, NIL, object_aclcheck(), OBJECT_FUNCTION, ExprEvalStep::opcode, palloc0(), ExprEvalStep::qualexpr, ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, TupleDescAttr(), NullableDatum::value, ExprEvalStep::var, VAR_RETURNING_DEFAULT, ExprEvalStep::varreturningtype, and ExprEvalStep::vartype.
Referenced by BuildTupleHashTable(), ExecInitSubPlan(), and execTuplesMatchPrepare().
ExprState * ExecBuildHash32Expr | ( | TupleDesc | desc, |
const TupleTableSlotOps * | ops, | ||
const Oid * | hashfunc_oids, | ||
const List * | collations, | ||
const List * | hash_exprs, | ||
const bool * | opstrict, | ||
PlanState * | parent, | ||
uint32 | init_value, | ||
bool | keep_nulls | ||
) |
Definition at line 4289 of file execExpr.c.
References FunctionCallInfoBaseData::args, Assert, ExprEvalStep::d, EEOP_DONE, EEOP_HASHDATUM_FIRST, EEOP_HASHDATUM_FIRST_STRICT, EEOP_HASHDATUM_NEXT32, EEOP_HASHDATUM_NEXT32_STRICT, EEOP_HASHDATUM_SET_INITVAL, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fcinfo_data, ExprEvalStep::finfo, fmgr_info(), ExprEvalStep::fn_addr, FmgrInfo::fn_addr, forboth, foreach_current_index, ExprEvalStep::hashdatum, ExprEvalStep::hashdatum_initvalue, i, ExprEvalStep::init_value, InitFunctionCallInfoData, ExprEvalStep::iresult, NullableDatum::isnull, ExprEvalStep::jumpdone, lappend_int(), lfirst, lfirst_int, lfirst_oid, list_length(), makeNode, NIL, ExprEvalStep::opcode, palloc(), palloc0(), ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, UInt32GetDatum(), and NullableDatum::value.
Referenced by ExecInitHashJoin().
ExprState * ExecBuildHash32FromAttrs | ( | TupleDesc | desc, |
const TupleTableSlotOps * | ops, | ||
FmgrInfo * | hashfunctions, | ||
Oid * | collations, | ||
int | numCols, | ||
AttrNumber * | keyColIdx, | ||
PlanState * | parent, | ||
uint32 | init_value | ||
) |
Definition at line 4130 of file execExpr.c.
References FunctionCallInfoBaseData::args, Assert, attnum, ExprEvalStep::attnum, ExprEvalStep::d, EEOP_DONE, EEOP_HASHDATUM_FIRST, EEOP_HASHDATUM_NEXT32, EEOP_HASHDATUM_SET_INITVAL, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, ExecComputeSlotInfo(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fcinfo_data, ExprEvalStep::fetch, ExprEvalStep::finfo, ExprEvalStep::fixed, ExprEvalStep::fn_addr, FmgrInfo::fn_addr, ExprEvalStep::hashdatum, ExprEvalStep::hashdatum_initvalue, i, ExprEvalStep::init_value, InitFunctionCallInfoData, ExprEvalStep::iresult, NullableDatum::isnull, ExprEvalStep::jumpdone, ExprEvalStep::kind, ExprEvalStep::known_desc, ExprEvalStep::last_var, makeNode, Max, ExprEvalStep::opcode, palloc(), palloc0(), ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, TupleDescAttr(), UInt32GetDatum(), NullableDatum::value, ExprEvalStep::var, VAR_RETURNING_DEFAULT, ExprEvalStep::varreturningtype, and ExprEvalStep::vartype.
Referenced by BuildTupleHashTable(), and ExecInitSubPlan().
ExprState * ExecBuildParamSetEqual | ( | TupleDesc | desc, |
const TupleTableSlotOps * | lops, | ||
const TupleTableSlotOps * | rops, | ||
const Oid * | eqfunctions, | ||
const Oid * | collations, | ||
const List * | param_exprs, | ||
PlanState * | parent | ||
) |
Definition at line 4613 of file execExpr.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, FunctionCallInfoBaseData::args, Assert, ExprEvalStep::attnum, collid, ExprEvalStep::d, EEO_FLAG_IS_QUAL, EEOP_DONE, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, EEOP_NOT_DISTINCT, EEOP_OUTER_FETCHSOME, EEOP_OUTER_VAR, EEOP_QUAL, ExecComputeSlotInfo(), ExecReadyExpr(), ExprEvalPushStep(), ExprEvalStep::fcinfo_data, ExprEvalStep::fetch, ExprEvalStep::finfo, ExprEvalStep::fixed, fmgr_info(), fmgr_info_set_expr, ExprEvalStep::fn_addr, FmgrInfo::fn_addr, ExprEvalStep::func, get_func_name(), GetUserId(), InitFunctionCallInfoData, InvokeFunctionExecuteHook, NullableDatum::isnull, ExprEvalStep::jumpdone, ExprEvalStep::kind, ExprEvalStep::known_desc, lappend_int(), ExprEvalStep::last_var, lfirst_int, list_length(), makeNode, ExprEvalStep::nargs, NIL, object_aclcheck(), OBJECT_FUNCTION, ExprEvalStep::opcode, palloc0(), ExprEvalStep::qualexpr, ExprEvalStep::resnull, ExprEvalStep::resvalue, SizeForFunctionCallInfo, TupleDescAttr(), NullableDatum::value, ExprEvalStep::var, VAR_RETURNING_DEFAULT, ExprEvalStep::varreturningtype, and ExprEvalStep::vartype.
Referenced by ExecInitMemoize().
ProjectionInfo * ExecBuildProjectionInfo | ( | List * | targetList, |
ExprContext * | econtext, | ||
TupleTableSlot * | slot, | ||
PlanState * | parent, | ||
TupleDesc | inputDesc | ||
) |
Definition at line 370 of file execExpr.c.
References ExprEvalStep::assign_tmp, ExprEvalStep::assign_var, attnum, ExprEvalStep::attnum, ExprEvalStep::d, EEO_FLAG_HAS_NEW, EEO_FLAG_HAS_OLD, EEOP_ASSIGN_INNER_VAR, EEOP_ASSIGN_NEW_VAR, EEOP_ASSIGN_OLD_VAR, EEOP_ASSIGN_OUTER_VAR, EEOP_ASSIGN_SCAN_VAR, EEOP_ASSIGN_TMP, EEOP_ASSIGN_TMP_MAKE_RO, EEOP_DONE, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), TargetEntry::expr, ExprEvalPushStep(), exprType(), get_typlen(), if(), INNER_VAR, IsA, lfirst_node, makeNode, ExprEvalStep::opcode, OUTER_VAR, ProjectionInfo::pi_exprContext, ProjectionInfo::pi_state, TargetEntry::resno, ExprEvalStep::resultnum, TupleDescAttr(), ExprState::type, VAR_RETURNING_DEFAULT, VAR_RETURNING_NEW, and VAR_RETURNING_OLD.
Referenced by ExecAssignProjectionInfo(), ExecInitInsertProjection(), ExecInitMerge(), ExecInitModifyTable(), ExecInitPartitionInfo(), and ExecInitSubPlan().
ProjectionInfo * ExecBuildUpdateProjection | ( | List * | targetList, |
bool | evalTargetList, | ||
List * | targetColnos, | ||
TupleDesc | relDesc, | ||
ExprContext * | econtext, | ||
TupleTableSlot * | slot, | ||
PlanState * | parent | ||
) |
Definition at line 547 of file execExpr.c.
References Assert, ExprEvalStep::assign_tmp, ExprEvalStep::assign_var, CompactAttribute::attisdropped, attnum, ExprEvalStep::attnum, bms_add_member(), bms_is_member(), ExprEvalStep::constval, ExprEvalStep::d, EEOP_ASSIGN_OUTER_VAR, EEOP_ASSIGN_SCAN_VAR, EEOP_ASSIGN_TMP, EEOP_CONST, EEOP_DONE, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, ExecInitExprRec(), ExecPushExprSetupSteps(), ExecReadyExpr(), TargetEntry::expr, expr_setup_walker(), ExprEvalPushStep(), exprType(), forboth, format_type_be(), ExprEvalStep::isnull, ExprSetupInfo::last_outer, ExprSetupInfo::last_scan, lfirst_int, lfirst_node, list_length(), makeNode, TupleDescData::natts, NIL, ExprEvalStep::opcode, ProjectionInfo::pi_exprContext, ProjectionInfo::pi_state, ExprEvalStep::resnull, ExprEvalStep::resultnum, ExprEvalStep::resvalue, TupleDescAttr(), TupleDescCompactAttr(), ExprState::type, and ExprEvalStep::value.
Referenced by ExecInitMerge(), ExecInitModifyTable(), ExecInitPartitionInfo(), and ExecInitUpdateProjection().
bool ExecCheck | ( | ExprState * | state, |
ExprContext * | econtext | ||
) |
Definition at line 872 of file execExpr.c.
References Assert, DatumGetBool(), EEO_FLAG_IS_QUAL, and ExecEvalExprSwitchContext().
Referenced by ATRewriteTable(), check_default_partition_contents(), domain_check_input(), ExecPartitionCheck(), and ExecRelCheck().
|
static |
Definition at line 3054 of file execExpr.c.
References Assert, ExprEvalStep::d, EEOP_INNER_FETCHSOME, EEOP_NEW_FETCHSOME, EEOP_OLD_FETCHSOME, EEOP_OUTER_FETCHSOME, EEOP_SCAN_FETCHSOME, ExecGetResultSlotOps(), ExecGetResultType(), ExprEvalStep::fetch, ExprEvalStep::fixed, PlanState::innerops, PlanState::inneropsfixed, PlanState::inneropsset, innerPlanState, ExprEvalStep::kind, ExprEvalStep::known_desc, ExprEvalStep::opcode, PlanState::outerops, PlanState::outeropsfixed, PlanState::outeropsset, outerPlanState, PlanState::scandesc, PlanState::scanops, PlanState::scanopsfixed, PlanState::scanopsset, and TTSOpsVirtual.
Referenced by ExecBuildGroupingEqual(), ExecBuildHash32FromAttrs(), ExecBuildParamSetEqual(), and ExecPushExprSetupSteps().
Definition at line 2873 of file execExpr.c.
References ExecPushExprSetupSteps(), expr_setup_walker(), and NIL.
Referenced by ExecBuildHash32Expr(), ExecBuildProjectionInfo(), ExecInitExpr(), ExecInitExprWithParams(), and ExecInitQual().
Definition at line 315 of file execExpr.c.
References Assert, ExecInitExpr(), IsA, make_ands_explicit(), and NIL.
Referenced by ExecPrepareCheck().
|
static |
Definition at line 3514 of file execExpr.c.
References CoerceToDomain::arg, DomainConstraintState::check_expr, ExprEvalStep::checknull, ExprEvalStep::checkvalue, ExprEvalStep::constraintname, DomainConstraintRef::constraints, DomainConstraintState::constrainttype, CurrentMemoryContext, ExprEvalStep::d, DOM_CONSTRAINT_CHECK, DOM_CONSTRAINT_NOTNULL, ExprEvalStep::domaincheck, EEOP_DOMAIN_CHECK, EEOP_DOMAIN_NOTNULL, EEOP_MAKE_READONLY, elog, ERROR, ExprEvalStep::escontext, ExecInitExprRec(), ExprEvalPushStep(), get_typlen(), InitDomainConstraintRef(), ExprEvalStep::isnull, lfirst, ExprEvalStep::make_readonly, DomainConstraintState::name, ExprEvalStep::opcode, palloc(), ExprEvalStep::resnull, ExprEvalStep::resulttype, CoerceToDomain::resulttype, ExprEvalStep::resvalue, and ExprEvalStep::value.
Referenced by ExecInitExprRec().
Definition at line 143 of file execExpr.c.
References EEOP_DONE, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), ExprEvalPushStep(), makeNode, and ExprEvalStep::opcode.
Referenced by ATRewriteTable(), BeginCopyFrom(), evaluate_expr(), ExecIndexBuildScanKeys(), ExecInitCheck(), ExecInitExprList(), ExecInitExprRec(), ExecInitLimit(), ExecInitMemoize(), ExecInitProjectSet(), ExecInitSampleScan(), ExecInitSubPlan(), ExecInitTableFuncScan(), ExecInitTableFunctionResult(), ExecInitWindowAgg(), ExecPrepareExpr(), get_cast_hashentry(), get_qual_for_range(), InitPartitionPruneContext(), MakeTidOpExpr(), MJExamineQuals(), operator_predicate_proof(), prep_domain_constraints(), slot_fill_defaults(), and TidExprListCreate().
Definition at line 335 of file execExpr.c.
References ExecInitExpr(), lappend(), lfirst, and NIL.
Referenced by ExecInitAgg(), ExecInitExprRec(), ExecInitFunctionResultSet(), ExecInitIndexScan(), ExecInitSampleScan(), ExecInitTableFuncScan(), ExecInitTableFunctionResult(), ExecInitValuesScan(), prepare_query_params(), and ValuesNext().
Definition at line 919 of file execExpr.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, WindowFuncExprState::aggfilter, WindowFunc::aggfilter, ExprEvalStep::aggno, ExprEvalStep::aggref, AggState::aggs, ExprEvalStep::amstate, AND_EXPR, ExprEvalStep::anynull, arg, FieldSelect::arg, FieldStore::arg, RelabelType::arg, CoerceViaIO::arg, ArrayCoerceExpr::arg, CaseExpr::arg, NullTest::arg, BooleanTest::arg, JsonConstructorExprState::arg_nulls, JsonConstructorExprState::arg_type_cache, JsonConstructorExprState::arg_types, JsonConstructorExprState::arg_values, ExprEvalStep::argnull, generate_unaccent_rules::args, FunctionCallInfoBaseData::args, WindowFuncExprState::args, WindowFunc::args, FuncExpr::args, OpExpr::args, ScalarArrayOpExpr::args, BoolExpr::args, CaseExpr::args, RowExpr::args, CoalesceExpr::args, MinMaxExpr::args, XmlExpr::args, JsonConstructorExpr::args, ExprEvalStep::argvalue, ExprEvalStep::arraycoerce, ExprEvalStep::arrayexpr, Assert, ExprEvalStep::attnum, BlessTupleDesc(), ExprEvalStep::boolexpr, BoolExpr::boolop, BooleanTest::booltesttype, BTORDER_PROC, ExprEvalRowtypeCache::cacheptr, ExprEvalStep::casetest, castNode, JsonConstructorExprState::category, check_stack_depth(), ExprEvalStep::clauses, CMD_MERGE, TypeCacheEntry::cmp_proc, ExprEvalStep::cmptype, RowCompareExpr::cmptype, JsonConstructorExpr::coercion, JsonConstructorExprState::constructor, ExprEvalStep::constval, FunctionCallInfoBaseData::context, convert(), ExprEvalStep::convert_rowtype, ExprEvalStep::d, CaseExpr::defresult, EEO_FLAG_HAS_NEW, EEO_FLAG_HAS_OLD, EEO_FLAG_NEW_IS_NULL, EEO_FLAG_OLD_IS_NULL, EEOP_AGGREF, EEOP_ARRAYCOERCE, EEOP_ARRAYEXPR, EEOP_BOOL_AND_STEP, EEOP_BOOL_AND_STEP_FIRST, EEOP_BOOL_AND_STEP_LAST, EEOP_BOOL_NOT_STEP, EEOP_BOOL_OR_STEP, EEOP_BOOL_OR_STEP_FIRST, EEOP_BOOL_OR_STEP_LAST, EEOP_BOOLTEST_IS_FALSE, EEOP_BOOLTEST_IS_NOT_FALSE, EEOP_BOOLTEST_IS_NOT_TRUE, EEOP_BOOLTEST_IS_TRUE, EEOP_CASE_TESTVAL, EEOP_CASE_TESTVAL_EXT, EEOP_CONST, EEOP_CONVERT_ROWTYPE, EEOP_CURRENTOFEXPR, EEOP_DISTINCT, EEOP_DOMAIN_TESTVAL, EEOP_DOMAIN_TESTVAL_EXT, EEOP_DONE, EEOP_FIELDSELECT, EEOP_FIELDSTORE_DEFORM, EEOP_FIELDSTORE_FORM, EEOP_GROUPING_FUNC, EEOP_HASHED_SCALARARRAYOP, EEOP_INNER_SYSVAR, EEOP_INNER_VAR, EEOP_IOCOERCE, EEOP_IOCOERCE_SAFE, EEOP_IS_JSON, EEOP_JSON_CONSTRUCTOR, EEOP_JUMP, EEOP_JUMP_IF_NOT_NULL, EEOP_JUMP_IF_NOT_TRUE, EEOP_MAKE_READONLY, EEOP_MERGE_SUPPORT_FUNC, EEOP_MINMAX, EEOP_NEW_SYSVAR, EEOP_NEW_VAR, EEOP_NEXTVALUEEXPR, EEOP_NULLIF, EEOP_NULLTEST_ISNOTNULL, EEOP_NULLTEST_ISNULL, EEOP_NULLTEST_ROWISNOTNULL, EEOP_NULLTEST_ROWISNULL, EEOP_OLD_SYSVAR, EEOP_OLD_VAR, EEOP_OUTER_SYSVAR, EEOP_OUTER_VAR, EEOP_PARAM_EXEC, EEOP_PARAM_EXTERN, EEOP_RETURNINGEXPR, EEOP_ROW, EEOP_ROWCOMPARE_FINAL, EEOP_ROWCOMPARE_STEP, EEOP_SCALARARRAYOP, EEOP_SCAN_SYSVAR, EEOP_SCAN_VAR, EEOP_SQLVALUEFUNCTION, EEOP_WINDOW_FUNC, EEOP_XMLEXPR, ExprEvalStep::elemalign, ExprEvalStep::elembyval, ExprEvalStep::element_type, ArrayExpr::elements, ArrayCoerceExpr::elemexpr, ExprEvalStep::elemexprstate, ExprEvalStep::elemlength, ExprEvalStep::elemnulls, ExprEvalStep::elemtype, ExprEvalStep::elemvalues, elog, ereport, errcode(), errmsg(), ERROR, ExecInitCoerceToDomain(), ExecInitExpr(), ExecInitExprList(), ExecInitExprRec(), ExecInitFunc(), ExecInitJsonExpr(), ExecInitSubPlanExpr(), ExecInitSubscriptingRef(), ExecInitWholeRowVar(), ExecReadyExpr(), ExecTypeFromExprList(), ExecTypeSetColNames(), ExprState::expr, JsonIsPredicate::expr, ExprEvalPushStep(), exprType(), ExprState::ext_params, ExprEvalStep::fcinfo_data, ExprEvalStep::fcinfo_data_in, ExprEvalStep::fcinfo_data_out, ExprEvalStep::fieldnum, FieldSelect::fieldnum, ExprEvalStep::fieldselect, ExprEvalStep::fieldstore, ExprEvalStep::finfo, ExprEvalStep::finfo_in, ExprEvalStep::finfo_out, fmgr_info(), fmgr_info_set_expr, ExprEvalStep::fn_addr, FmgrInfo::fn_addr, forboth, forfive, JsonReturning::format, JsonFormat::format_type, format_type_be(), JsonValueExpr::formatted_expr, JsonExpr::formatted_expr, ExprEvalStep::fstore, ExprEvalStep::func, JsonConstructorExpr::func, FuncExpr::funcid, WindowAggState::funcs, get_element_type(), get_func_name(), get_op_opfamily_properties(), get_opfamily_proc(), get_typlen(), get_typlenbyvalalign(), getTypeInputInfo(), getTypeOutputInfo(), GetUserId(), ExprEvalStep::grouping_func, Agg::groupingSets, ExprEvalStep::hashedscalararrayop, i, ExprEvalStep::incache, ExprEvalStep::inclause, InitFunctionCallInfoData, INNER_VAR, ExprState::innermost_casenull, ExprState::innermost_caseval, ExprEvalStep::inputtype, Int32GetDatum(), InvalidAttrNumber, InvalidOid, InvokeFunctionExecuteHook, ExprEvalStep::iocoerce, IS_FALSE, ExprEvalStep::is_json, IS_NOT_FALSE, IS_NOT_NULL, IS_NOT_TRUE, IS_NOT_UNKNOWN, IS_NULL, IS_TRUE, IS_UNKNOWN, IsA, ExprEvalStep::isnull, NullableDatum::isnull, ExprEvalStep::jcstate, JS_FORMAT_JSONB, JSCTOR_JSON_PARSE, JSCTOR_JSON_SCALAR, JSCTOR_JSON_SERIALIZE, json_categorize_type(), ExprEvalStep::json_constructor, JSON_TABLE_OP, ExprEvalStep::jump, ExprEvalStep::jumpdone, ExprEvalStep::jumpnull, lappend(), lappend_int(), RowCompareExpr::largs, lfirst, lfirst_int, lfirst_oid, linitial, list_length(), lookup_rowtype_tupdesc(), lookup_rowtype_tupdesc_copy(), lookup_type_cache(), lsecond, ExprEvalStep::make_readonly, ExprEvalStep::make_ro, makeNode, makeNullConst(), ExprEvalStep::map, Max, ExprEvalStep::minmax, ExprEvalStep::multidims, MULTIEXPR_SUBLINK, ExprEvalStep::named_argnull, XmlExpr::named_args, ExprEvalStep::named_argvalue, JsonConstructorExprState::nargs, TupleDescData::natts, ExprEvalStep::ncolumns, ExprEvalStep::nelems, FieldStore::newvals, ExprEvalStep::nextvalueexpr, NIL, nodeTag, NOT_EXPR, ExprEvalStep::nullflag, ExprEvalStep::nulls, ExprEvalStep::nulltest_row, NullTest::nulltesttype, WindowAggState::numaggs, WindowAggState::numfuncs, object_aclcheck(), OBJECT_FUNCTION, ObjectIdGetDatum(), OidIsValid, ExprEvalStep::op, MinMaxExpr::op, JsonExpr::op, ExprEvalStep::opcode, OR_EXPR, ExprEvalStep::outcache, OUTER_VAR, JsonConstructorExprState::outfuncid, ExprEvalStep::outputtype, palloc(), palloc0(), ExprEvalStep::param, PARAM_EXEC, PARAM_EXTERN, ParamListInfoData::paramCompile, ExprEvalStep::paramid, Param::paramid, Param::paramkind, ExprEvalStep::paramtype, Param::paramtype, ExprState::parent, ExprEvalStep::pred, RowCompareExpr::rargs, JsonValueExpr::raw_expr, ReleaseTupleDesc, ExprEvalStep::resnull, ExprState::resnull, ExprEvalStep::resultelemtype, ExprEvalStep::resulttype, CoerceViaIO::resulttype, ArrayCoerceExpr::resulttype, ExprEvalStep::resvalue, ExprState::resvalue, ReturningExpr::retexpr, ReturningExpr::retold, JsonConstructorExpr::returning, ExprEvalStep::returningexpr, ExprEvalStep::row, ExprEvalStep::rowcache, ExprEvalStep::rowcompare_final, ExprEvalStep::rowcompare_step, ExprEvalStep::saop, ExprEvalStep::scalararrayop, ExprEvalStep::seqid, NextValueExpr::seqid, ExprEvalStep::seqtypid, SizeForFunctionCallInfo, ExprEvalStep::sqlvaluefunction, ExprState::steps, ExprState::steps_len, SubPlan::subLinkType, ExprEvalStep::svf, ExprEvalStep::tupdesc, TupleDescAttr(), JsonConstructorExpr::type, TYPECACHE_CMP_PROC, NextValueExpr::typeId, JsonConstructorExpr::unique, ExprEvalStep::useOr, ScalarArrayOpExpr::useOr, ExprEvalStep::value, NullableDatum::value, values, ExprEvalStep::values, ExprEvalStep::var, VAR_RETURNING_DEFAULT, VAR_RETURNING_NEW, VAR_RETURNING_OLD, ExprEvalStep::varreturningtype, ExprEvalStep::vartype, ExprEvalStep::wfstate, WindowFuncExprState::wfunc, ExprEvalStep::window_func, ExprEvalStep::xexpr, and ExprEvalStep::xmlexpr.
Referenced by ExecBuildAggTrans(), ExecBuildHash32Expr(), ExecBuildProjectionInfo(), ExecBuildUpdateProjection(), ExecInitCoerceToDomain(), ExecInitExpr(), ExecInitExprRec(), ExecInitExprWithParams(), ExecInitFunc(), ExecInitJsonExpr(), ExecInitQual(), ExecInitSubPlanExpr(), and ExecInitSubscriptingRef().
ExprState * ExecInitExprWithParams | ( | Expr * | node, |
ParamListInfo | ext_params | ||
) |
Definition at line 180 of file execExpr.c.
References EEOP_DONE, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), ExprEvalPushStep(), makeNode, and ExprEvalStep::opcode.
Referenced by exec_eval_simple_expr(), and InitPartitionPruneContext().
|
static |
Definition at line 2704 of file execExpr.c.
References ACL_EXECUTE, aclcheck_error(), ACLCHECK_OK, arg, generate_unaccent_rules::args, FunctionCallInfoBaseData::args, ExprEvalStep::d, EEOP_FUNCEXPR, EEOP_FUNCEXPR_FUSAGE, EEOP_FUNCEXPR_STRICT, EEOP_FUNCEXPR_STRICT_FUSAGE, ereport, errcode(), errmsg(), errmsg_plural(), ERROR, ExecInitExprRec(), executor_errposition(), exprLocation(), ExprEvalStep::fcinfo_data, ExprEvalStep::finfo, fmgr_info(), fmgr_info_set_expr, ExprEvalStep::fn_addr, FmgrInfo::fn_addr, FmgrInfo::fn_retset, FmgrInfo::fn_strict, ExprEvalStep::func, FUNC_MAX_ARGS, get_func_name(), GetUserId(), InitFunctionCallInfoData, InvokeFunctionExecuteHook, IsA, NullableDatum::isnull, lfirst, list_length(), ExprEvalStep::nargs, object_aclcheck(), OBJECT_FUNCTION, ExprEvalStep::opcode, palloc0(), SizeForFunctionCallInfo, and NullableDatum::value.
Referenced by ExecInitExprRec().
|
static |
Definition at line 5039 of file execExpr.c.
References ExprEvalStep::d, DomainHasConstraints(), EEOP_JSONEXPR_COERCION, ExprEvalStep::escontext, ExprEvalStep::exists_cast_to_int, ExprEvalStep::exists_check_domain, ExprEvalStep::exists_coerce, ExprEvalPushStep(), getBaseType(), ExprEvalStep::json_coercion_cache, ExprEvalStep::jsonexpr_coercion, ExprEvalStep::omit_quotes, ExprEvalStep::opcode, ExprEvalStep::resnull, ExprEvalStep::resvalue, ExprEvalStep::targettype, ExprEvalStep::targettypmod, JsonReturning::typid, and JsonReturning::typmod.
Referenced by ExecInitJsonExpr().
|
static |
Definition at line 4737 of file execExpr.c.
References FunctionCallInfoBaseData::args, JsonExprState::args, Assert, JsonBehavior::btype, JsonBehavior::coerce, ExprEvalStep::constval, FunctionCallInfoBaseData::context, ExprEvalStep::d, EEOP_CONST, EEOP_JSONEXPR_COERCION_FINISH, EEOP_JSONEXPR_PATH, EEOP_JUMP, EEOP_JUMP_IF_NOT_TRUE, EEOP_JUMP_IF_NULL, JsonExprState::empty, JsonExprState::error, JsonExprState::escontext, ExecInitExprRec(), ExecInitJsonCoercion(), JsonBehavior::expr, ExprEvalPushStep(), exprType(), exprTypmod(), fmgr_info(), fmgr_info_set_expr, forboth, JsonExprState::formatted_expr, JsonExpr::formatted_expr, get_typtype(), getTypeInputInfo(), InitFunctionCallInfoData, JsonExprState::input_fcinfo, Int32GetDatum(), InvalidOid, IsA, ExprEvalStep::isnull, NullableDatum::isnull, JsonPathVariable::isnull, ExprEvalStep::jsestate, JsonExprState::jsexpr, JSON_BEHAVIOR_ERROR, JSON_EXISTS_OP, ExprEvalStep::jsonexpr, ExprEvalStep::jump, JsonExprState::jump_empty, JsonExprState::jump_end, JsonExprState::jump_error, JsonExprState::jump_eval_coercion, ExprEvalStep::jumpdone, lappend(), lappend_int(), lfirst, lfirst_int, lfirst_node, JsonPathVariable::name, JsonPathVariable::namelen, NIL, ObjectIdGetDatum(), JsonExpr::omit_quotes, JsonExpr::on_empty, JsonExpr::on_error, JsonExpr::op, ExprEvalStep::opcode, palloc(), palloc0(), JsonExpr::passing_names, JsonExpr::passing_values, JsonExpr::path_spec, JsonExprState::pathspec, ExprEvalStep::resnull, ExprEvalStep::resvalue, JsonExpr::returning, SizeForFunctionCallInfo, String::sval, ErrorSaveContext::type, JsonReturning::typid, JsonPathVariable::typid, JsonReturning::typmod, JsonPathVariable::typmod, JsonExpr::use_io_coercion, JsonExpr::use_json_coercion, ExprEvalStep::value, NullableDatum::value, and JsonPathVariable::value.
Referenced by ExecInitExprRec().
Definition at line 229 of file execExpr.c.
References Assert, ExprEvalStep::d, EEO_FLAG_IS_QUAL, EEOP_DONE, EEOP_QUAL, ExecCreateExprSetupSteps(), ExecInitExprRec(), ExecReadyExpr(), ExprEvalPushStep(), foreach_int, foreach_ptr, IsA, ExprEvalStep::jumpdone, lappend_int(), makeNode, NIL, ExprEvalStep::opcode, ExprEvalStep::qualexpr, ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by CopyFrom(), ExecInitAgg(), ExecInitBitmapHeapScan(), ExecInitCteScan(), ExecInitCustomScan(), ExecInitForeignScan(), ExecInitFunctionScan(), ExecInitGroup(), ExecInitHashJoin(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), ExecInitMerge(), ExecInitMergeJoin(), ExecInitModifyTable(), ExecInitNamedTuplestoreScan(), ExecInitNestLoop(), ExecInitPartitionInfo(), ExecInitResult(), ExecInitSampleScan(), ExecInitSeqScan(), ExecInitSubqueryScan(), ExecInitTableFuncScan(), ExecInitTidRangeScan(), ExecInitTidScan(), ExecInitValuesScan(), ExecInitWindowAgg(), ExecInitWorkTableScan(), and ExecPrepareQual().
|
static |
Definition at line 2813 of file execExpr.c.
References arg, SubPlan::args, Assert, ExprEvalStep::d, EEOP_PARAM_SET, EEOP_SUBPLAN, elog, ERROR, ExecInitExprRec(), ExecInitSubPlan(), ExprEvalPushStep(), exprType(), forboth, lappend(), lfirst, lfirst_int, list_length(), ExprEvalStep::opcode, ExprEvalStep::param, ExprEvalStep::paramid, ExprEvalStep::paramtype, SubPlan::parParam, ExprEvalStep::resnull, ExprEvalStep::resvalue, ExprEvalStep::sstate, and ExprEvalStep::subplan.
Referenced by ExecInitExprRec(), and ExecPushExprSetupSteps().
|
static |
Definition at line 3235 of file execExpr.c.
References Assert, ExprEvalStep::d, EEOP_JUMP_IF_NULL, EEOP_SBSREF_ASSIGN, EEOP_SBSREF_FETCH, EEOP_SBSREF_OLD, EEOP_SBSREF_SUBSCRIPTS, ereport, errcode(), errmsg(), ERROR, SubscriptRoutines::exec_setup, ExecInitExprRec(), executor_errposition(), ExprEvalPushStep(), exprLocation(), SubscriptRoutines::fetch_strict, format_type_be(), getSubscriptingRoutines(), i, SubscriptingRefState::isassignment, isAssignmentIndirectionExpr(), ExprEvalStep::jump, ExprEvalStep::jumpdone, lappend_int(), lfirst, lfirst_int, list_length(), SubscriptingRefState::lowerindex, SubscriptingRefState::lowerindexnull, SubscriptingRefState::lowerprovided, MAXALIGN, NIL, SubscriptingRefState::numlower, SubscriptingRefState::numupper, ExprEvalStep::opcode, palloc0(), SubscriptingRefState::prevnull, SubscriptingRefState::prevvalue, SubscriptingRef::refassgnexpr, SubscriptingRef::refexpr, SubscriptingRef::reflowerindexpr, SubscriptingRef::refupperindexpr, SubscriptingRefState::replacenull, SubscriptingRefState::replacevalue, SubscriptExecSteps::sbs_assign, SubscriptExecSteps::sbs_check_subscripts, SubscriptExecSteps::sbs_fetch, SubscriptExecSteps::sbs_fetch_old, ExprEvalStep::sbsref, ExprEvalStep::sbsref_subscript, ExprEvalStep::state, ExprEvalStep::subscriptfunc, SubscriptingRefState::upperindex, SubscriptingRefState::upperindexnull, and SubscriptingRefState::upperprovided.
Referenced by ExecInitExprRec().
|
static |
Definition at line 3156 of file execExpr.c.
References ExprEvalStep::d, EEO_FLAG_HAS_NEW, EEO_FLAG_HAS_OLD, EEOP_WHOLEROW, ExecInitExtraTupleSlot(), ExecInitJunkFilter(), ExprEvalStep::first, ExprEvalStep::junkFilter, lfirst, nodeTag, ExprEvalStep::opcode, PlanState::plan, ExprEvalStep::slow, PlanState::state, Plan::targetlist, TTSOpsVirtual, ExprEvalStep::tupdesc, ExprEvalStep::var, VAR_RETURNING_NEW, VAR_RETURNING_OLD, and ExprEvalStep::wholerow.
Referenced by ExecInitExprRec().
Definition at line 816 of file execExpr.c.
References EState::es_query_cxt, ExecInitCheck(), expression_planner(), and MemoryContextSwitchTo().
Referenced by ExecPartitionCheck().
Definition at line 765 of file execExpr.c.
References EState::es_query_cxt, ExecInitExpr(), expression_planner(), and MemoryContextSwitchTo().
Referenced by ATExecAddColumn(), ATRewriteTable(), check_default_partition_contents(), compute_expr_stats(), ExecInitGenerated(), ExecPrepareExprList(), ExecRelCheck(), ExecuteCallStmt(), pgoutput_row_filter_init(), and validateDomainCheckConstraint().
Definition at line 839 of file execExpr.c.
References EState::es_query_cxt, ExecPrepareExpr(), lappend(), lfirst, MemoryContextSwitchTo(), and NIL.
Referenced by EvaluateParams(), FormIndexDatum(), FormPartitionKeyDatum(), and make_build_data().
Definition at line 793 of file execExpr.c.
References EState::es_query_cxt, ExecInitQual(), expression_planner(), and MemoryContextSwitchTo().
Referenced by compute_index_stats(), ExecCheckIndexConstraints(), ExecInsertIndexTuples(), heapam_index_build_range_scan(), heapam_index_validate_scan(), IndexCheckExclusion(), and TriggerEnabled().
|
static |
Definition at line 2889 of file execExpr.c.
References Assert, ExprEvalStep::d, EEOP_INNER_FETCHSOME, EEOP_NEW_FETCHSOME, EEOP_OLD_FETCHSOME, EEOP_OUTER_FETCHSOME, EEOP_SCAN_FETCHSOME, ExecComputeSlotInfo(), ExecInitSubPlanExpr(), ExprEvalPushStep(), ExprEvalStep::fetch, ExprEvalStep::fixed, ExprEvalStep::kind, ExprEvalStep::known_desc, ExprSetupInfo::last_inner, ExprSetupInfo::last_new, ExprSetupInfo::last_old, ExprSetupInfo::last_outer, ExprSetupInfo::last_scan, ExprEvalStep::last_var, lfirst, MULTIEXPR_SUBLINK, ExprSetupInfo::multiexpr_subplans, ExprEvalStep::opcode, ExprEvalStep::resnull, ExprEvalStep::resvalue, and SubPlan::subLinkType.
Referenced by ExecBuildAggTrans(), ExecBuildUpdateProjection(), and ExecCreateExprSetupSteps().
|
static |
Definition at line 902 of file execExpr.c.
References ExecReadyInterpretedExpr(), and jit_compile_expr().
Referenced by ExecBuildAggTrans(), ExecBuildGroupingEqual(), ExecBuildHash32Expr(), ExecBuildHash32FromAttrs(), ExecBuildParamSetEqual(), ExecBuildProjectionInfo(), ExecBuildUpdateProjection(), ExecInitExpr(), ExecInitExprRec(), ExecInitExprWithParams(), and ExecInitQual().
|
static |
Definition at line 2975 of file execExpr.c.
References attnum, expr_setup_walker(), expression_tree_walker, INNER_VAR, IsA, lappend(), ExprSetupInfo::last_inner, ExprSetupInfo::last_new, ExprSetupInfo::last_old, ExprSetupInfo::last_outer, ExprSetupInfo::last_scan, Max, MULTIEXPR_SUBLINK, ExprSetupInfo::multiexpr_subplans, OUTER_VAR, SubPlan::subLinkType, VAR_RETURNING_DEFAULT, VAR_RETURNING_NEW, and VAR_RETURNING_OLD.
Referenced by ExecBuildAggTrans(), ExecBuildUpdateProjection(), ExecCreateExprSetupSteps(), and expr_setup_walker().
void ExprEvalPushStep | ( | ExprState * | es, |
const ExprEvalStep * | s | ||
) |
Definition at line 2678 of file execExpr.c.
References palloc(), repalloc(), ExprState::steps, ExprState::steps_alloc, and ExprState::steps_len.
Referenced by ExecBuildAggTrans(), ExecBuildAggTransCall(), ExecBuildGroupingEqual(), ExecBuildHash32Expr(), ExecBuildHash32FromAttrs(), ExecBuildParamSetEqual(), ExecBuildProjectionInfo(), ExecBuildUpdateProjection(), ExecInitCoerceToDomain(), ExecInitExpr(), ExecInitExprRec(), ExecInitExprWithParams(), ExecInitJsonCoercion(), ExecInitJsonExpr(), ExecInitQual(), ExecInitSubPlanExpr(), ExecInitSubscriptingRef(), ExecPushExprSetupSteps(), and plpgsql_param_compile().
|
static |
Definition at line 3477 of file execExpr.c.
References FieldStore::arg, RelabelType::arg, CoerceToDomain::arg, IsA, isAssignmentIndirectionExpr(), and SubscriptingRef::refexpr.
Referenced by ExecInitSubscriptingRef(), and isAssignmentIndirectionExpr().