PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ExprEvalStep |
struct | SubscriptingRefState |
struct | SubscriptExecSteps |
Macros | |
#define | EEO_FLAG_INTERPRETER_INITIALIZED (1 << 1) |
#define | EEO_FLAG_DIRECT_THREADED (1 << 2) |
Typedefs | |
typedef void(* | ExecEvalSubroutine) (ExprState *state, struct ExprEvalStep *op, ExprContext *econtext) |
typedef bool(* | ExecEvalBoolSubroutine) (ExprState *state, struct ExprEvalStep *op, ExprContext *econtext) |
typedef enum ExprEvalOp | ExprEvalOp |
typedef struct ExprEvalStep | ExprEvalStep |
typedef struct SubscriptingRefState | SubscriptingRefState |
typedef struct SubscriptExecSteps | SubscriptExecSteps |
#define EEO_FLAG_DIRECT_THREADED (1 << 2) |
Definition at line 28 of file execExpr.h.
Referenced by ExecEvalStepOp(), and ExecReadyInterpretedExpr().
#define EEO_FLAG_INTERPRETER_INITIALIZED (1 << 1) |
Definition at line 26 of file execExpr.h.
Referenced by ExecReadyInterpretedExpr().
typedef bool(* ExecEvalBoolSubroutine) (ExprState *state, struct ExprEvalStep *op, ExprContext *econtext) |
Definition at line 36 of file execExpr.h.
typedef void(* ExecEvalSubroutine) (ExprState *state, struct ExprEvalStep *op, ExprContext *econtext) |
Definition at line 31 of file execExpr.h.
typedef enum ExprEvalOp ExprEvalOp |
typedef struct ExprEvalStep ExprEvalStep |
typedef struct SubscriptExecSteps SubscriptExecSteps |
typedef struct SubscriptingRefState SubscriptingRefState |
enum ExprEvalOp |
Definition at line 49 of file execExpr.h.
void CheckExprStillValid | ( | ExprState * | state, |
ExprContext * | econtext | ||
) |
Definition at line 1773 of file execExprInterp.c.
References attnum, CheckVarSlotCompatibility(), ExprEvalStep::d, ExprContext::ecxt_innertuple, ExprContext::ecxt_outertuple, ExprContext::ecxt_scantuple, EEOP_INNER_VAR, EEOP_OUTER_VAR, EEOP_SCAN_VAR, ExecEvalStepOp(), i, ExprState::steps, ExprState::steps_len, and ExprEvalStep::var.
Referenced by ExecInterpExprStillValid(), and ExecRunCompiledExpr().
void ExecAggInitGroup | ( | AggState * | aggstate, |
AggStatePerTrans | pertrans, | ||
AggStatePerGroup | pergroup, | ||
ExprContext * | aggcontext | ||
) |
Definition at line 3896 of file execExprInterp.c.
References FunctionCallInfoBaseData::args, datumCopy(), ExprContext::ecxt_per_tuple_memory, MemoryContextSwitchTo(), AggStatePerGroupData::noTransValue, AggStatePerTransData::transfn_fcinfo, AggStatePerTransData::transtypeByVal, AggStatePerTransData::transtypeLen, AggStatePerGroupData::transValue, AggStatePerGroupData::transValueIsNull, and NullableDatum::value.
Referenced by ExecInterpExpr().
Datum ExecAggTransReparent | ( | AggState * | aggstate, |
AggStatePerTrans | pertrans, | ||
Datum | newValue, | ||
bool | newValueIsNull, | ||
Datum | oldValue, | ||
bool | oldValueIsNull | ||
) |
Definition at line 3924 of file execExprInterp.c.
References Assert, AggState::curaggcontext, CurrentMemoryContext, datumCopy(), DatumGetEOHP(), DatumGetPointer, DatumIsReadWriteExpandedObject, DeleteExpandedObject(), ExprContext::ecxt_per_tuple_memory, MemoryContextGetParent(), MemoryContextSwitchTo(), pfree(), AggStatePerTransData::transtypeByVal, and AggStatePerTransData::transtypeLen.
Referenced by advance_transition_function(), and ExecAggPlainTransByRef().
void ExecEvalAggOrderedTransDatum | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3970 of file execExprInterp.c.
References ExprEvalStep::agg_trans, ExprEvalStep::d, ExprEvalStep::resnull, ExprEvalStep::resvalue, AggStatePerTransData::sortstates, and tuplesort_putdatum().
Referenced by ExecInterpExpr().
void ExecEvalAggOrderedTransTuple | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3984 of file execExprInterp.c.
References ExprEvalStep::agg_trans, ExprEvalStep::d, ExecClearTuple(), ExecStoreVirtualTuple(), AggStatePerTransData::numInputs, pg_attribute_always_inline, AggStatePerTransData::sortslot, AggStatePerTransData::sortstates, TupleTableSlot::tts_nvalid, and tuplesort_puttupleslot().
Referenced by ExecInterpExpr().
void ExecEvalArrayCoerce | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2798 of file execExprInterp.c.
References ARR_ELEMTYPE, array_map(), ExprEvalStep::arraycoerce, ExprEvalStep::d, DatumGetArrayTypePCopy, PointerGetDatum, ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by ExecInterpExpr().
void ExecEvalArrayExpr | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2593 of file execExprInterp.c.
References ARR_DATA_OFFSET, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, ARR_NULLBITMAP, ARR_OVERHEAD_NONULLS, ARR_OVERHEAD_WITHNULLS, ARR_SIZE, array_bitmap_copy(), ExprEvalStep::arrayexpr, ArrayGetNItems(), construct_empty_array(), construct_md_array(), ExprEvalStep::d, ArrayType::dataoffset, DatumGetArrayTypeP, ArrayType::elemtype, ereport, errcode(), errdetail(), errmsg(), ERROR, format_type_be(), i, MAXDIM, ArrayType::ndim, palloc(), PointerGetDatum, ExprEvalStep::resnull, ExprEvalStep::resvalue, and SET_VARSIZE.
Referenced by ExecInterpExpr().
void ExecEvalConstraintCheck | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 3366 of file execExprInterp.c.
References ExprEvalStep::d, DatumGetBool, ExprEvalStep::domaincheck, ereport, errcode(), errdomainconstraint(), errmsg(), ERROR, and format_type_be().
Referenced by ExecInterpExpr().
void ExecEvalConstraintNotNull | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 3352 of file execExprInterp.c.
References ExprEvalStep::d, ExprEvalStep::domaincheck, ereport, errcode(), errdatatype(), errmsg(), ERROR, format_type_be(), and ExprEvalStep::resnull.
Referenced by ExecInterpExpr().
void ExecEvalConvertRowtype | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3104 of file execExprInterp.c.
References ConvertRowtypeExpr::arg, Assert, convert(), ExprEvalStep::convert_rowtype, convert_tuples_by_name(), ExprEvalStep::d, DatumGetHeapTupleHeader, ExprContext::ecxt_per_query_memory, execute_attr_map_tuple(), exprType(), get_cached_rowtype(), heap_copy_tuple_as_datum(), HeapTupleGetDatum, HeapTupleHeaderGetDatumLength, HeapTupleHeaderGetTypeId, MemoryContextSwitchTo(), ExprEvalStep::resnull, ConvertRowtypeExpr::resulttype, ExprEvalStep::resvalue, HeapTupleData::t_data, HeapTupleData::t_len, and TupleDescData::tdtypeid.
Referenced by ExecInterpExpr().
void ExecEvalCurrentOfExpr | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2453 of file execExprInterp.c.
References ereport, errcode(), errmsg(), and ERROR.
Referenced by ExecInterpExpr().
void ExecEvalFieldSelect | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2912 of file execExprInterp.c.
References Assert, ExprEvalStep::d, DatumGetEOHP(), DatumGetHeapTupleHeader, DatumGetPointer, elog, ER_MAGIC, ExpandedRecordHeader::er_magic, ereport, errcode(), errdetail(), errmsg(), ERROR, expanded_record_get_field(), expanded_record_get_tupdesc(), ExprEvalStep::fieldselect, format_type_be(), get_cached_rowtype(), heap_getattr, HeapTupleHeaderGetDatumLength, HeapTupleHeaderGetTypeId, HeapTupleHeaderGetTypMod, TupleDescData::natts, ExprEvalStep::resnull, ExprEvalStep::resvalue, HeapTupleData::t_data, HeapTupleData::t_len, TupleDescAttr, and VARATT_IS_EXTERNAL_EXPANDED.
Referenced by ExecInterpExpr().
void ExecEvalFieldStoreDeForm | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3038 of file execExprInterp.c.
References ExprEvalStep::d, DatumGetHeapTupleHeader, elog, ERROR, ExprEvalStep::fieldstore, get_cached_rowtype(), heap_deform_tuple(), HeapTupleHeaderGetDatumLength, InvalidOid, ItemPointerSetInvalid, TupleDescData::natts, ExprEvalStep::resnull, ExprEvalStep::resvalue, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, and unlikely.
Referenced by ExecInterpExpr().
void ExecEvalFieldStoreForm | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3084 of file execExprInterp.c.
References ExprEvalStep::d, ExprEvalStep::fieldstore, heap_form_tuple(), HeapTupleGetDatum, ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by ExecInterpExpr().
void ExecEvalFuncExprFusage | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2264 of file execExprInterp.c.
References ExprEvalStep::d, ExprEvalStep::func, FunctionCallInfoBaseData::isnull, pgstat_end_function_usage(), pgstat_init_function_usage(), ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by ExecInterpExpr().
void ExecEvalFuncExprStrictFusage | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2285 of file execExprInterp.c.
References FunctionCallInfoBaseData::args, generate_unaccent_rules::args, ExprEvalStep::d, ExprEvalStep::func, FunctionCallInfoBaseData::isnull, pgstat_end_function_usage(), pgstat_init_function_usage(), ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by ExecInterpExpr().
void ExecEvalGroupingFunc | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 3605 of file execExprInterp.c.
References attnum, bms_is_member(), castNode, ExprEvalStep::d, AggState::grouped_cols, ExprEvalStep::grouping_func, Int32GetDatum, lfirst_int, ExprState::parent, ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by ExecInterpExpr().
void ExecEvalMinMax | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2859 of file execExprInterp.c.
References FunctionCallInfoBaseData::args, Assert, ExprEvalStep::d, DatumGetInt32, FunctionCallInvoke, IS_GREATEST, IS_LEAST, FunctionCallInfoBaseData::isnull, NullableDatum::isnull, ExprEvalStep::minmax, ExprEvalStep::resnull, ExprEvalStep::resvalue, NullableDatum::value, and values.
Referenced by ExecInterpExpr().
void ExecEvalNextValueExpr | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2464 of file execExprInterp.c.
References ExprEvalStep::d, elog, ERROR, Int16GetDatum, Int32GetDatum, Int64GetDatum(), newval, nextval_internal(), ExprEvalStep::nextvalueexpr, ExprEvalStep::resnull, and ExprEvalStep::resvalue.
Referenced by ExecInterpExpr().
void ExecEvalParamExec | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2322 of file execExprInterp.c.
References Assert, ExprEvalStep::d, ExprContext::ecxt_param_exec_vals, ParamExecData::execPlan, ExecSetParamPlan(), ParamExecData::isnull, ExprEvalStep::param, ExprEvalStep::resnull, ExprEvalStep::resvalue, unlikely, and ParamExecData::value.
Referenced by ExecInterpExpr().
void ExecEvalParamExtern | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2344 of file execExprInterp.c.
References ExprEvalStep::d, ExprContext::ecxt_param_list_info, ereport, errcode(), errmsg(), ERROR, format_type_be(), ParamExternData::isnull, likely, OidIsValid, ExprEvalStep::param, ParamListInfoData::paramFetch, ParamListInfoData::params, ParamExternData::ptype, ExprEvalStep::resnull, ExprEvalStep::resvalue, unlikely, and ParamExternData::value.
Referenced by ExecInterpExpr().
void ExecEvalRow | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2839 of file execExprInterp.c.
References ExprEvalStep::d, heap_form_tuple(), HeapTupleGetDatum, ExprEvalStep::resnull, ExprEvalStep::resvalue, and ExprEvalStep::row.
Referenced by ExecInterpExpr().
void ExecEvalRowNotNull | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2499 of file execExprInterp.c.
References ExecEvalRowNullInt().
Referenced by ExecInterpExpr().
void ExecEvalRowNull | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 2490 of file execExprInterp.c.
References ExecEvalRowNullInt().
Referenced by ExecInterpExpr().
void ExecEvalScalarArrayOp | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 3202 of file execExprInterp.c.
References FunctionCallInfoBaseData::args, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_NDIM, ARR_NULLBITMAP, ArrayGetNItems(), att_addlength_pointer, att_align_nominal, BoolGetDatum, ExprEvalStep::d, DatumGetArrayTypeP, DatumGetBool, fetch_att, get_typlenbyvalalign(), i, FunctionCallInfoBaseData::isnull, NullableDatum::isnull, ExprEvalStep::resnull, ExprEvalStep::resvalue, ExprEvalStep::scalararrayop, typalign, and NullableDatum::value.
Referenced by ExecInterpExpr().
void ExecEvalSQLValueFunction | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2386 of file execExprInterp.c.
References current_database(), current_schema(), current_user(), ExprEvalStep::d, DateADTGetDatum, GetSQLCurrentDate(), GetSQLCurrentTime(), GetSQLCurrentTimestamp(), GetSQLLocalTime(), GetSQLLocalTimestamp(), InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, SQLValueFunction::op, ExprEvalStep::resnull, ExprEvalStep::resvalue, session_user(), ExprEvalStep::sqlvaluefunction, SVFOP_CURRENT_CATALOG, SVFOP_CURRENT_DATE, SVFOP_CURRENT_ROLE, SVFOP_CURRENT_SCHEMA, SVFOP_CURRENT_TIME, SVFOP_CURRENT_TIME_N, SVFOP_CURRENT_TIMESTAMP, SVFOP_CURRENT_TIMESTAMP_N, SVFOP_CURRENT_USER, SVFOP_LOCALTIME, SVFOP_LOCALTIME_N, SVFOP_LOCALTIMESTAMP, SVFOP_LOCALTIMESTAMP_N, SVFOP_SESSION_USER, SVFOP_USER, TimeADTGetDatum, TimestampGetDatum, TimestampTzGetDatum, TimeTzADTPGetDatum, and SQLValueFunction::typmod.
Referenced by ExecInterpExpr().
ExprEvalOp ExecEvalStepOp | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 2234 of file execExprInterp.c.
References Assert, EEO_FLAG_DIRECT_THREADED, EEOP_LAST, ExprState::flags, sort-test::key, and ExprEvalStep::opcode.
Referenced by CheckExprStillValid(), and llvm_compile_expr().
void ExecEvalSubPlan | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3630 of file execExprInterp.c.
References check_stack_depth(), ExprEvalStep::d, ExecSubPlan(), ExprEvalStep::resnull, ExprEvalStep::resvalue, and ExprEvalStep::subplan.
Referenced by ExecInterpExpr().
void ExecEvalSysVar | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext, | ||
TupleTableSlot * | slot | ||
) |
Definition at line 3876 of file execExprInterp.c.
References ExprEvalStep::d, elog, ERROR, ExprEvalStep::resnull, ExprEvalStep::resvalue, slot_getsysattr(), unlikely, and ExprEvalStep::var.
Referenced by ExecInterpExpr().
void ExecEvalWholeRowVar | ( | ExprState * | state, |
ExprEvalStep * | op, | ||
ExprContext * | econtext | ||
) |
Definition at line 3647 of file execExprInterp.c.
References Assert, BlessTupleDesc(), Alias::colnames, CreateTupleDescCopy(), ExprEvalStep::d, ExprContext::ecxt_estate, ExprContext::ecxt_innertuple, ExprContext::ecxt_outertuple, ExprContext::ecxt_per_query_memory, ExprContext::ecxt_scantuple, RangeTblEntry::eref, ereport, errcode(), errdetail(), errdetail_plural(), errmsg(), ERROR, EState::es_range_table_size, exec_rt_fetch(), ExecFilterJunk(), ExecTypeSetColNames(), format_type_be(), HeapTupleHeaderSetTypeId, HeapTupleHeaderSetTypMod, i, INNER_VAR, InvalidAttrNumber, lookup_rowtype_tupdesc_domain(), MemoryContextSwitchTo(), TupleDescData::natts, OUTER_VAR, PointerGetDatum, ReleaseTupleDesc, ExprEvalStep::resnull, ExprEvalStep::resvalue, slot_getallattrs(), HeapTupleData::t_data, toast_build_flattened_tuple(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, TupleDescAttr, Var::varattno, Var::varno, Var::vartype, and ExprEvalStep::wholerow.
Referenced by ExecInterpExpr().
void ExecEvalXmlExpr | ( | ExprState * | state, |
ExprEvalStep * | op | ||
) |
Definition at line 3386 of file execExprInterp.c.
References appendStringInfo(), arg, XmlExpr::arg_names, XmlExpr::args, Assert, BoolGetDatum, buf, cstring_to_text_with_len(), ExprEvalStep::d, StringInfoData::data, DatumGetBool, DatumGetInt32, DatumGetPointer, DatumGetTextPP, DatumGetXmlP, elog, ERROR, exprType(), forboth, i, initStringInfo(), IS_DOCUMENT, IS_XMLCONCAT, IS_XMLELEMENT, IS_XMLFOREST, IS_XMLPARSE, IS_XMLPI, IS_XMLROOT, IS_XMLSERIALIZE, lappend(), StringInfoData::len, lfirst, list_length(), map_sql_value_to_xml_value(), XmlExpr::name, XmlExpr::named_args, NIL, XmlExpr::op, pfree(), PointerGetDatum, ExprEvalStep::resnull, ExprEvalStep::resvalue, strVal, value, values, xml_is_document(), xmlconcat(), xmlelement(), ExprEvalStep::xmlexpr, XmlExpr::xmloption, xmlparse(), xmlpi(), xmlroot(), and xmltotext_with_xmloption().
Referenced by ExecInterpExpr().
Datum ExecInterpExprStillValid | ( | ExprState * | state, |
ExprContext * | econtext, | ||
bool * | isNull | ||
) |
Definition at line 1753 of file execExprInterp.c.
References CheckExprStillValid(), ExprState::evalfunc, and ExprState::evalfunc_private.
Referenced by ExecReadyInterpretedExpr().
void ExecReadyInterpretedExpr | ( | ExprState * | state | ) |
Definition at line 185 of file execExprInterp.c.
References Assert, ExprEvalStep::casetest, ExprEvalStep::d, EEO_FLAG_DIRECT_THREADED, EEO_FLAG_INTERPRETER_INITIALIZED, EEO_OPCODE, EEOP_ASSIGN_INNER_VAR, EEOP_ASSIGN_OUTER_VAR, EEOP_ASSIGN_SCAN_VAR, EEOP_CASE_TESTVAL, EEOP_CONST, EEOP_DONE, EEOP_FUNCEXPR_STRICT, EEOP_INNER_FETCHSOME, EEOP_INNER_VAR, EEOP_OUTER_FETCHSOME, EEOP_OUTER_VAR, EEOP_SCAN_FETCHSOME, EEOP_SCAN_VAR, ExprState::evalfunc, ExprState::evalfunc_private, ExecInitInterpreter(), ExecInterpExpr(), ExecInterpExprStillValid(), ExecJustApplyFuncToCase(), ExecJustAssignInnerVar(), ExecJustAssignInnerVarVirt(), ExecJustAssignOuterVar(), ExecJustAssignOuterVarVirt(), ExecJustAssignScanVar(), ExecJustAssignScanVarVirt(), ExecJustConst(), ExecJustInnerVar(), ExecJustInnerVarVirt(), ExecJustOuterVar(), ExecJustOuterVarVirt(), ExecJustScanVar(), ExecJustScanVarVirt(), ExprState::flags, ExprEvalStep::opcode, ExprState::steps, and ExprState::steps_len.
Referenced by ExecReadyExpr().
void ExprEvalPushStep | ( | ExprState * | es, |
const ExprEvalStep * | s | ||
) |
Definition at line 2105 of file execExpr.c.
References palloc(), repalloc(), ExprState::steps, ExprState::steps_alloc, and ExprState::steps_len.
Referenced by ExecBuildAggTrans(), ExecBuildAggTransCall(), ExecBuildGroupingEqual(), ExecBuildProjectionInfo(), ExecInitCoerceToDomain(), ExecInitExpr(), ExecInitExprRec(), ExecInitExprWithParams(), ExecInitQual(), ExecInitSubscriptingRef(), ExecPushExprSlots(), and plpgsql_param_compile().