90#ifdef HAVE_COMPUTED_GOTO
91#define EEO_USE_COMPUTED_GOTO
104#if defined(EEO_USE_COMPUTED_GOTO)
120#define EEO_CASE(name) CASE_##name:
121#define EEO_DISPATCH() goto *((void *) op->opcode)
122#define EEO_OPCODE(opcode) ((intptr_t) dispatch_table[opcode])
126#define EEO_SWITCH() starteval: switch ((ExprEvalOp) op->opcode)
127#define EEO_CASE(name) case name:
128#define EEO_DISPATCH() goto starteval
129#define EEO_OPCODE(opcode) (opcode)
139#define EEO_JUMP(stepno) \
141 op = &state->steps[stepno]; \
212#define SH_PREFIX saophash
213#define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
214#define SH_KEY_TYPE Datum
215#define SH_SCOPE static inline
236#define SH_PREFIX saophash
237#define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
238#define SH_KEY_TYPE Datum
240#define SH_HASH_KEY(tb, key) saop_element_hash(tb, key)
241#define SH_EQUAL(tb, a, b) saop_hash_element_match(tb, a, b)
242#define SH_SCOPE static inline
244#define SH_GET_HASH(tb, a) a->hash
293 if (
state->steps_len == 5)
309 else if (
state->steps_len == 4)
337 else if (
state->steps_len == 3)
399 else if (
state->steps_len == 2)
440#if defined(EEO_USE_COMPUTED_GOTO)
446 for (
int off = 0; off <
state->steps_len; off++)
483#if defined(EEO_USE_COMPUTED_GOTO)
609 "dispatch_table out of whack with ExprEvalOp");
619 resultslot =
state->resultslot;
626#if defined(EEO_USE_COMPUTED_GOTO)
635 return state->resvalue;
799 int attnum =
op->d.assign_var.attnum;
816 int attnum =
op->d.assign_var.attnum;
833 int attnum =
op->d.assign_var.attnum;
850 int attnum =
op->d.assign_var.attnum;
867 int attnum =
op->d.assign_var.attnum;
909 *
op->resnull =
op->d.constval.isnull;
910 *
op->resvalue =
op->d.constval.value;
936 d =
op->d.func.fn_addr(fcinfo);
963 d =
op->d.func.fn_addr(fcinfo);
987 d =
op->d.func.fn_addr(fcinfo);
1005 *
op->resnull =
true;
1011 d =
op->d.func.fn_addr(fcinfo);
1047 *
op->d.boolexpr.anynull =
false;
1061 *
op->d.boolexpr.anynull =
true;
1089 else if (*
op->d.boolexpr.anynull)
1092 *
op->resnull =
true;
1114 *
op->d.boolexpr.anynull =
false;
1128 *
op->d.boolexpr.anynull =
true;
1156 else if (*
op->d.boolexpr.anynull)
1159 *
op->resnull =
true;
1191 *
op->resnull =
false;
1240 *
op->resnull =
false;
1248 *
op->resnull =
false;
1276 *
op->resnull =
false;
1288 *
op->resnull =
false;
1301 *
op->resnull =
false;
1314 *
op->resnull =
false;
1339 op->d.cparam.paramfunc(
state,
op, econtext);
1352 *
op->resvalue = *
op->d.casetest.value;
1353 *
op->resnull = *
op->d.casetest.isnull;
1371 if (!*
op->d.make_readonly.isnull)
1374 *
op->resnull = *
op->d.make_readonly.isnull;
1413 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str !=
NULL)
1467 *
op->resnull =
false;
1473 *
op->resnull =
false;
1498 *
op->resnull =
false;
1503 *
op->resnull =
false;
1538 if (
op->d.func.make_ro)
1543 result =
op->d.func.fn_addr(fcinfo);
1549 *
op->resnull =
true;
1598 if (
state->flags &
op->d.returningexpr.nullflag)
1601 *
op->resnull =
true;
1639 if (
op->d.rowcompare_step.finfo->fn_strict &&
1642 *
op->resnull =
true;
1648 d =
op->d.rowcompare_step.fn_addr(fcinfo);
1654 *
op->resnull =
true;
1657 *
op->resnull =
false;
1673 *
op->resnull =
false;
1732 if (
op->d.sbsref_subscript.subscriptfunc(
state,
op, econtext))
1748 op->d.sbsref.subscriptfunc(
state,
op, econtext);
1779 *
op->resvalue = *
op->d.casetest.value;
1780 *
op->resnull = *
op->d.casetest.isnull;
1811 *
op->resvalue =
op->d.hashdatum_initvalue.init_value;
1812 *
op->resnull =
false;
1826 *
op->resvalue =
op->d.hashdatum.fn_addr(fcinfo);
1830 *
op->resnull =
false;
1846 *
op->resnull =
true;
1852 *
op->resvalue =
op->d.hashdatum.fn_addr(fcinfo);
1853 *
op->resnull =
false;
1878 *
op->resnull =
false;
1894 *
op->resnull =
true;
1910 *
op->resnull =
false;
1967 int aggno =
op->d.aggref.aggno;
2020 if (
op->d.agg_deserialize.fcinfo_data->args[0].isnull)
2055 int nargs =
op->d.agg_strict_input_check.nargs;
2062 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2076 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2082 bool *
nulls =
op->d.agg_strict_input_check.nulls;
2083 int nargs =
op->d.agg_strict_input_check.nargs;
2088 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2101 aggstate->all_pergroups[
op->d.agg_plain_pergroup_nullcheck.setoff];
2104 EEO_JUMP(
op->d.agg_plain_pergroup_nullcheck.jumpnull);
2126 &
aggstate->all_pergroups[
op->d.agg_trans.setoff][
op->d.agg_trans.transno];
2134 op->d.agg_trans.aggcontext);
2141 op->d.agg_trans.aggcontext,
2142 op->d.agg_trans.setno);
2154 &
aggstate->all_pergroups[
op->d.agg_trans.setoff][
op->d.agg_trans.transno];
2160 op->d.agg_trans.aggcontext,
2161 op->d.agg_trans.setno);
2172 &
aggstate->all_pergroups[
op->d.agg_trans.setoff][
op->d.agg_trans.transno];
2177 op->d.agg_trans.aggcontext,
2178 op->d.agg_trans.setno);
2189 &
aggstate->all_pergroups[
op->d.agg_trans.setoff][
op->d.agg_trans.transno];
2195 op->d.agg_trans.aggcontext);
2198 op->d.agg_trans.aggcontext,
2199 op->d.agg_trans.setno);
2210 &
aggstate->all_pergroups[
op->d.agg_trans.setoff][
op->d.agg_trans.transno];
2216 op->d.agg_trans.aggcontext,
2217 op->d.agg_trans.setno);
2227 &
aggstate->all_pergroups[
op->d.agg_trans.setoff][
op->d.agg_trans.transno];
2232 op->d.agg_trans.aggcontext,
2233 op->d.agg_trans.setno);
2246 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
2257 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
2309 return state->evalfunc(
state, econtext, isNull);
2331 for (
int i = 0;
i <
state->steps_len;
i++)
2413 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
2420 elog(
ERROR,
"unexpected virtual generated column reference");
2422 if (attr->attisdropped)
2425 errmsg(
"attribute %d of type %s has been dropped",
2428 if (
vartype != attr->atttypid)
2431 errmsg(
"attribute %d of type %s has wrong type",
2433 errdetail(
"Table has type %s, but query expects %s.",
2445#ifdef USE_ASSERT_CHECKING
2447 if (!
op->d.fetch.fixed)
2513 errmsg(
"type %s is not composite",
2597 int attnum =
op->d.assign_var.attnum + 1;
2654 *
op->resnull = *
op->d.casetest.isnull;
2659 fcinfo =
op->d.func.fcinfo_data;
2672 d =
op->d.func.fn_addr(fcinfo);
2684 return op->d.constval.value;
2735 int attnum =
op->d.assign_var.attnum;
2828 return hashop->d.hashdatum.fn_addr(fcinfo);
2862 return hashop->d.hashdatum.fn_addr(fcinfo);
2905 return hashop->d.hashdatum.fn_addr(fcinfo);
2915#if defined(EEO_USE_COMPUTED_GOTO)
2926 if (
la->opcode < lb->opcode)
2928 else if (
la->opcode > lb->opcode)
2940#if defined(EEO_USE_COMPUTED_GOTO)
2972#if defined(EEO_USE_COMPUTED_GOTO)
2978 key.opcode = (
void *)
op->opcode;
3010 d =
op->d.func.fn_addr(fcinfo);
3036 *
op->resnull =
true;
3044 d =
op->d.func.fn_addr(fcinfo);
3070 *
op->resvalue =
prm->value;
3071 *
op->resnull =
prm->isnull;
3083 int paramId =
op->d.param.paramid;
3103 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
3107 *
op->resvalue =
prm->value;
3108 *
op->resnull =
prm->isnull;
3115 errmsg(
"no value found for parameter %d", paramId)));
3132 prm->value = *
op->resvalue;
3133 prm->isnull = *
op->resnull;
3171 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str !=
NULL)
3188 *
op->resnull =
true;
3210 *
op->resnull =
false;
3242 *
op->resnull = fcinfo->isnull;
3247 *
op->resnull = fcinfo->isnull;
3252 *
op->resnull = fcinfo->isnull;
3257 *
op->resnull = fcinfo->isnull;
3276 errmsg(
"WHERE CURRENT OF is not supported for this table type")));
3287 switch (
op->d.nextvalueexpr.seqtypid)
3299 elog(
ERROR,
"unsupported sequence type %u",
3300 op->d.nextvalueexpr.seqtypid);
3302 *
op->resnull =
false;
3336 *
op->resnull =
false;
3368 &
op->d.nulltest_row.rowcache,
NULL);
3376 for (
int att = 1; att <= tupDesc->
natts; att++)
3415 int nelems =
op->d.arrayexpr.nelems;
3421 *
op->resnull =
false;
3423 if (!
op->d.arrayexpr.multidims)
3426 Datum *dvalues =
op->d.arrayexpr.elemvalues;
3427 bool *dnulls =
op->d.arrayexpr.elemnulls;
3436 op->d.arrayexpr.elemlength,
3437 op->d.arrayexpr.elembyval,
3438 op->d.arrayexpr.elemalign);
3489 errmsg(
"cannot merge incompatible arrays"),
3490 errdetail(
"Array with element type %s cannot be "
3491 "included in ARRAY construct with element type %s.",
3511 errmsg(
"number of array dimensions (%d) exceeds the maximum allowed (%d)",
3531 errmsg(
"multidimensional arrays must have array "
3532 "expressions with matching dimensions")));
3543 errmsg(
"array size exceeds the maximum allowed (%d)",
3566 errmsg(
"multidimensional arrays must have array "
3567 "expressions with matching dimensions")));
3573 for (
int i = 1;
i < ndims;
i++)
3586 nbytes += dataoffset;
3597 result->dataoffset = dataoffset;
3639 if (
op->d.arraycoerce.elemexprstate ==
NULL)
3653 op->d.arraycoerce.elemexprstate,
3655 op->d.arraycoerce.resultelemtype,
3656 op->d.arraycoerce.amstate);
3672 op->d.row.elemvalues,
3673 op->d.row.elemnulls);
3676 *
op->resnull =
false;
3689 bool *
nulls =
op->d.minmax.nulls;
3698 *
op->resnull =
true;
3700 for (
int off = 0; off <
op->d.minmax.nelems; off++)
3710 *
op->resnull =
false;
3772 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3775 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3780 if (attr->attisdropped)
3782 *
op->resnull =
true;
3788 if (
op->d.fieldselect.resulttype != attr->atttypid)
3792 errdetail(
"Table has type %s, but query expects %s.",
3810 &
op->d.fieldselect.rowcache,
NULL);
3818 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3821 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3826 if (attr->attisdropped)
3828 *
op->resnull =
true;
3834 if (
op->d.fieldselect.resulttype != attr->atttypid)
3838 errdetail(
"Table has type %s, but query expects %s.",
3869 memset(
op->d.fieldstore.nulls,
true,
3870 op->d.fieldstore.ncolumns *
sizeof(
bool));
3896 op->d.fieldstore.rowcache,
NULL);
3900 elog(
ERROR,
"too many columns in composite type %u",
3901 op->d.fieldstore.fstore->resulttype);
3904 op->d.fieldstore.values,
3905 op->d.fieldstore.nulls);
3921 op->d.fieldstore.rowcache,
NULL);
3924 op->d.fieldstore.values,
3925 op->d.fieldstore.nulls);
3928 *
op->resnull =
false;
3961 op->d.convert_rowtype.incache,
3965 op->d.convert_rowtype.outcache,
3996 if (
op->d.convert_rowtype.map !=
NULL)
4036 bool useOr =
op->d.scalararrayop.useOr;
4037 bool strictfunc =
op->d.scalararrayop.finfo->fn_strict;
4063 *
op->resnull =
false;
4073 *
op->resnull =
true;
4084 &
op->d.scalararrayop.typlen,
4085 &
op->d.scalararrayop.typbyval,
4086 &
op->d.scalararrayop.typalign);
4092 op->d.scalararrayop.typlen,
4093 op->d.scalararrayop.typbyval,
4094 op->d.scalararrayop.typalign,
4139 if (bitmap && (*bitmap & bitmask) == 0)
4191 if (bitmask == 0x100)
4261 bool inclause =
op->d.hashedscalararrayop.inclause;
4262 bool strictfunc =
op->d.hashedscalararrayop.finfo->fn_strict;
4278 *
op->resnull =
true;
4298 saop =
op->d.hashedscalararrayop.saop;
4344 if (bitmap && (*bitmap & bitmask) == 0)
4363 if (bitmask == 0x100)
4402 op->d.hashedscalararrayop.null_lhs_isnull =
resultnull;
4415 *
op->resnull =
op->d.hashedscalararrayop.null_lhs_isnull;
4438 if (!
hashfound &&
op->d.hashedscalararrayop.has_nulls)
4464 result =
op->d.hashedscalararrayop.finfo->fn_addr(fcinfo);
4489 errmsg(
"domain %s does not allow null values",
4500 if (!*
op->d.domaincheck.checknull &&
4504 errmsg(
"value for domain %s violates check constraint \"%s\"",
4506 op->d.domaincheck.constraintname),
4508 op->d.domaincheck.constraintname)));
4523 *
op->resnull =
true;
4543 *
op->resnull =
false;
4551 bool *
argnull =
op->d.xmlexpr.named_argnull;
4573 *
op->resnull =
false;
4592 op->d.xmlexpr.named_argvalue,
4593 op->d.xmlexpr.named_argnull,
4594 op->d.xmlexpr.argvalue,
4595 op->d.xmlexpr.argnull));
4596 *
op->resnull =
false;
4622 *
op->resnull =
false;
4681 *
op->resnull =
false;
4701 *
op->resnull =
false;
4719 *
op->resnull =
false;
4724 elog(
ERROR,
"unrecognized XML operation");
4801 elog(
ERROR,
"invalid JsonConstructorExpr type %d",
ctor->type);
4803 *
op->resvalue = res;
4947 *
op->resnull =
false;
4973 *
op->resnull =
true;
4975 else if (!
error && !empty)
4986 *
op->resnull =
false;
5007 elog(
ERROR,
"unrecognized SQL/JSON expression op %d",
5020 Assert(jump_eval_coercion == -1);
5050 *
op->resnull =
true;
5077 errmsg(
"no SQL/JSON item found for specified path of column \"%s\"",
5082 errmsg(
"no SQL/JSON item found for specified path"));
5093 *
op->resnull =
true;
5127 str[item->
val.string.len] =
'\0';
5140 switch (item->
val.datetime.typid)
5144 item->
val.datetime.value));
5147 item->
val.datetime.value));
5150 item->
val.datetime.value));
5153 item->
val.datetime.value));
5156 item->
val.datetime.value));
5158 elog(
ERROR,
"unexpected jsonb datetime type oid %u",
5159 item->
val.datetime.typid);
5201 if (
op->d.jsonexpr_coercion.exists_coerce)
5203 if (
op->d.jsonexpr_coercion.exists_cast_to_int)
5206 if (
op->d.jsonexpr_coercion.exists_check_domain &&
5208 op->d.jsonexpr_coercion.targettype,
5209 &
op->d.jsonexpr_coercion.json_coercion_cache,
5213 *
op->resnull =
true;
5228 op->d.jsonexpr_coercion.targettype,
5229 op->d.jsonexpr_coercion.targettypmod,
5230 &
op->d.jsonexpr_coercion.json_coercion_cache,
5233 op->d.jsonexpr_coercion.omit_quotes,
5282 errmsg(
"could not coerce %s expression (%s) to the RETURNING type",
5290 errmsg(
"could not coerce %s expression (%s) to the RETURNING type",
5296 *
op->resnull =
true;
5326 foreach(
lc,
op->d.grouping_func.clauses)
5337 *
op->resnull =
false;
5353 elog(
ERROR,
"no merge action in progress");
5356 switch (
relaction->mas_action->commandType)
5360 *
op->resnull =
false;
5364 *
op->resnull =
false;
5368 *
op->resnull =
false;
5371 elog(
ERROR,
"unexpected merge action: DO NOTHING");
5374 elog(
ERROR,
"unrecognized commandType: %d",
5375 (
int)
relaction->mas_action->commandType);
5436 switch (
variable->varreturningtype)
5446 *
op->resnull =
true;
5456 *
op->resnull =
true;
5466 if (
op->d.wholerow.junkFilter !=
NULL)
5476 if (
op->d.wholerow.first)
5479 op->d.wholerow.slow =
false;
5513 errmsg(
"table row type and query-specified row type do not match"),
5515 "Table row contains %d attributes, but query expects %d.",
5527 if (!
vattr->attisdropped)
5530 errmsg(
"table row type and query-specified row type do not match"),
5531 errdetail(
"Table has type %s at ordinal position %d, but query expects %s.",
5538 op->d.wholerow.slow =
true;
5599 op->d.wholerow.first =
false;
5608 if (
op->d.wholerow.slow)
5621 if (!
vattr->attisdropped)
5629 errmsg(
"table row type and query-specified row type do not match"),
5630 errdetail(
"Physical storage mismatch on dropped attribute at ordinal position %d.",
5655 *
op->resnull =
false;
5671 *
op->resnull =
true;
5682 elog(
ERROR,
"failed to fetch attribute from slot");
5706 pergroup->transValueIsNull =
false;
5886 int setno =
op->d.agg_trans.setno;
5889 *
op->resvalue, *
op->resnull);
5900 int setno =
op->d.agg_trans.setno;
#define DatumGetArrayTypePCopy(X)
#define ARR_NULLBITMAP(a)
#define ARR_OVERHEAD_WITHNULLS(ndims, nitems)
#define DatumGetArrayTypeP(X)
#define ARR_OVERHEAD_NONULLS(ndims)
#define ARR_DATA_OFFSET(a)
ArrayType * construct_empty_array(Oid elmtype)
void array_bitmap_copy(uint8 *destbitmap, int destoffset, const uint8 *srcbitmap, int srcoffset, int nitems)
Datum array_map(Datum arrayd, ExprState *exprstate, ExprContext *econtext, Oid retType, ArrayMapState *amstate)
ArrayType * construct_md_array(Datum *elems, bool *nulls, int ndims, int *dims, int *lbs, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
int ArrayGetNItems(int ndim, const int *dims)
void ArrayCheckBounds(int ndim, const int *dims, const int *lb)
#define InvalidAttrNumber
Datum current_database(PG_FUNCTION_ARGS)
Datum numeric_out(PG_FUNCTION_ARGS)
Timestamp GetSQLLocalTimestamp(int32 typmod)
Datum timestamptz_out(PG_FUNCTION_ARGS)
Datum timestamp_out(PG_FUNCTION_ARGS)
TimestampTz GetSQLCurrentTimestamp(int32 typmod)
bool bms_is_member(int x, const Bitmapset *a)
Datum boolout(PG_FUNCTION_ARGS)
static Datum values[MAXATTR]
#define PG_USED_FOR_ASSERTS_ONLY
#define Assert(condition)
#define pg_attribute_always_inline
#define StaticAssertDecl(condition, errmessage)
#define OidIsValid(objectId)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
int64 nextval_internal(Oid relid, bool check_permissions)
TimeADT GetSQLLocalTime(int32 typmod)
Datum date_out(PG_FUNCTION_ARGS)
Datum time_out(PG_FUNCTION_ARGS)
DateADT GetSQLCurrentDate(void)
TimeTzADT * GetSQLCurrentTime(int32 typmod)
Datum timetz_out(PG_FUNCTION_ARGS)
static Datum DateADTGetDatum(DateADT X)
static Datum TimeTzADTPGetDatum(const TimeTzADT *X)
static Datum TimeADTGetDatum(TimeADT X)
Datum datumCopy(Datum value, bool typByVal, int typLen)
int errdatatype(Oid datatypeOid)
int errdomainconstraint(Oid datatypeOid, const char *conname)
bool domain_check_safe(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt, Node *escontext)
int errcode(int sqlerrcode)
#define errsave(context,...)
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
void ExecEvalParamExtern(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFieldStoreForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalGroupingFunc(ExprState *state, ExprEvalStep *op)
static void CheckVarSlotCompatibility(TupleTableSlot *slot, int attnum, Oid vartype)
void ExecEvalRow(ExprState *state, ExprEvalStep *op)
static pg_attribute_always_inline Datum ExecJustVarVirtImpl(ExprState *state, TupleTableSlot *slot, bool *isnull)
static pg_attribute_always_inline Datum ExecJustAssignVarImpl(ExprState *state, TupleTableSlot *inslot, bool *isnull)
void ExecEvalFieldStoreDeForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalCurrentOfExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSQLValueFunction(ExprState *state, ExprEvalStep *op)
void ExecEvalRowNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalParamSet(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustAssignInnerVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static char * GetJsonBehaviorValueString(JsonBehavior *behavior)
void ExecEvalCoerceViaIOSafe(ExprState *state, ExprEvalStep *op)
static Datum ExecJustScanVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustApplyFuncToCase(ExprState *state, ExprContext *econtext, bool *isnull)
Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull)
static pg_attribute_always_inline void ExecAggPlainTransByVal(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext, int setno)
static Datum ExecJustAssignScanVar(ExprState *state, ExprContext *econtext, bool *isnull)
static pg_attribute_always_inline Datum ExecJustHashVarImpl(ExprState *state, TupleTableSlot *slot, bool *isnull)
void ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustHashInnerVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate, AggStatePerTrans pertrans)
void ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustInnerVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustHashInnerVarWithIV(ExprState *state, ExprContext *econtext, bool *isnull)
int ExecEvalJsonExprPath(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op)
static void ExecInitInterpreter(void)
void ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
void ExecEvalAggOrderedTransDatum(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustConst(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustOuterVar(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalParamExec(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonCoercion(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext)
static pg_attribute_always_inline Datum ExecJustAssignVarVirtImpl(ExprState *state, TupleTableSlot *inslot, bool *isnull)
void ExecEvalNextValueExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSysVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext, TupleTableSlot *slot)
static bool saop_hash_element_match(struct saophash_hash *tb, Datum key1, Datum key2)
void ExecEvalMinMax(ExprState *state, ExprEvalStep *op)
void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonIsPredicate(ExprState *state, ExprEvalStep *op)
static uint32 saop_element_hash(struct saophash_hash *tb, Datum key)
static Datum ExecJustInnerVar(ExprState *state, ExprContext *econtext, bool *isnull)
Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans, Datum newValue, bool newValueIsNull, Datum oldValue, bool oldValueIsNull)
static Datum ExecJustAssignInnerVar(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustHashOuterVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalMergeSupportFunc(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void CheckExprStillValid(ExprState *state, ExprContext *econtext)
void ExecEvalJsonConstructor(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalWholeRowVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalHashedScalarArrayOp(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonCoercionFinish(ExprState *state, ExprEvalStep *op)
static pg_attribute_always_inline Datum ExecJustHashVarVirtImpl(ExprState *state, TupleTableSlot *slot, bool *isnull)
void ExecReadyInterpretedExpr(ExprState *state)
static char * ExecGetJsonValueItemString(JsonbValue *item, bool *resnull)
static Datum ExecJustAssignScanVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static void ExecEvalRowNullInt(ExprState *state, ExprEvalStep *op, ExprContext *econtext, bool checkisnull)
void ExecEvalRowNotNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustHashOuterVarStrict(ExprState *state, ExprContext *econtext, bool *isnull)
ExprEvalOp ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
static Datum ExecJustAssignOuterVar(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustHashOuterVar(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustAssignOuterVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
void ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op)
void ExecEvalArrayCoerce(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static void CheckOpSlotCompatibility(ExprEvalStep *op, TupleTableSlot *slot)
void ExecEvalFuncExprStrictFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static Datum ExecJustOuterVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecJustScanVar(ExprState *state, ExprContext *econtext, bool *isnull)
static Datum ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
static pg_attribute_always_inline Datum ExecJustVarImpl(ExprState *state, TupleTableSlot *slot, bool *isnull)
void ExecEvalFuncExprFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op)
bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate, AggStatePerTrans pertrans)
#define EEO_OPCODE(opcode)
static pg_attribute_always_inline void ExecEvalArrayCompareInternal(FunctionCallInfo fcinfo, ArrayType *arr, int16 typlen, bool typbyval, char typalign, bool useOr, Datum *result, bool *resultnull)
static pg_attribute_always_inline void ExecAggPlainTransByRef(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext, int setno)
void ExecEvalAggOrderedTransTuple(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
static TupleDesc get_cached_rowtype(Oid type_id, int32 typmod, ExprEvalRowtypeCache *rowcache, bool *changed)
static Datum ExecJustHashInnerVar(ExprState *state, ExprContext *econtext, bool *isnull)
#define EEO_FLAG_INTERPRETER_INITIALIZED
#define EEO_FLAG_DIRECT_THREADED
@ EEOP_FUNCEXPR_STRICT_FUSAGE
@ EEOP_HASHDATUM_NEXT32_STRICT
@ EEOP_JSONEXPR_COERCION_FINISH
@ EEOP_HASHDATUM_FIRST_STRICT
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
@ EEOP_AGG_STRICT_DESERIALIZE
@ EEOP_BOOLTEST_IS_NOT_FALSE
@ EEOP_AGG_PLAIN_TRANS_BYREF
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
@ EEOP_AGG_PLAIN_TRANS_BYVAL
@ EEOP_NULLTEST_ROWISNOTNULL
@ EEOP_ASSIGN_TMP_MAKE_RO
@ EEOP_BOOL_OR_STEP_FIRST
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS_1
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS
@ EEOP_NULLTEST_ROWISNULL
@ EEOP_NULLTEST_ISNOTNULL
@ EEOP_MERGE_SUPPORT_FUNC
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
@ EEOP_BOOL_AND_STEP_FIRST
@ EEOP_DOMAIN_TESTVAL_EXT
@ EEOP_BOOL_AND_STEP_LAST
@ EEOP_AGG_ORDERED_TRANS_DATUM
@ EEOP_HASHDATUM_SET_INITVAL
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
@ EEOP_BOOLTEST_IS_NOT_TRUE
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
@ EEOP_HASHED_SCALARARRAYOP
@ EEOP_AGG_ORDERED_TRANS_TUPLE
TupleTableSlot * ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
const TupleTableSlotOps TTSOpsVirtual
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
const TupleTableSlotOps TTSOpsBufferHeapTuple
const TupleTableSlotOps TTSOpsHeapTuple
Datum(* ExprStateEvalFunc)(ExprState *expression, ExprContext *econtext, bool *isNull)
#define EEO_FLAG_NEW_IS_NULL
#define EEO_FLAG_OLD_IS_NULL
static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)
static bool ExecQual(ExprState *state, ExprContext *econtext)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void DeleteExpandedObject(Datum d)
Datum MakeExpandedObjectReadOnlyInternal(Datum d)
#define DatumIsReadWriteExpandedObject(d, isnull, typlen)
static Datum expanded_record_get_field(ExpandedRecordHeader *erh, int fnumber, bool *isnull)
static TupleDesc expanded_record_get_tupdesc(ExpandedRecordHeader *erh)
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
#define DatumGetHeapTupleHeader(X)
#define DatumGetTextPP(X)
#define SizeForFunctionCallInfo(nargs)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define DirectFunctionCall1(func, arg1)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCallInvoke(fcinfo)
#define fmgr_info_set_expr(expr, finfo)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
HeapTuple toast_build_flattened_tuple(TupleDesc tupleDesc, const Datum *values, const bool *isnull)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
static void HeapTupleHeaderSetTypMod(HeapTupleHeaderData *tup, int32 typmod)
static int32 HeapTupleHeaderGetTypMod(const HeapTupleHeaderData *tup)
static void HeapTupleHeaderSetTypeId(HeapTupleHeaderData *tup, Oid datum_typeid)
static uint32 HeapTupleHeaderGetDatumLength(const HeapTupleHeaderData *tup)
static Oid HeapTupleHeaderGetTypeId(const HeapTupleHeaderData *tup)
Datum bool_int4(PG_FUNCTION_ARGS)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
Datum json_build_array_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null)
Datum json_build_object_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null, bool unique_keys)
Datum datum_to_json(Datum val, JsonTypeCategory tcategory, Oid outfuncoid)
bool json_validate(text *json, bool check_unique_keys, bool throw_error)
@ JSON_TOKEN_OBJECT_START
Datum jsonb_from_text(text *js, bool unique_keys)
Datum jsonb_build_array_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null)
Datum jsonb_in(PG_FUNCTION_ARGS)
Datum jsonb_out(PG_FUNCTION_ARGS)
Datum jsonb_build_object_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null, bool unique_keys)
Datum datum_to_jsonb(Datum val, JsonTypeCategory tcategory, Oid outfuncoid)
#define JB_ROOT_IS_OBJECT(jbp_)
static Datum JsonbPGetDatum(const Jsonb *p)
#define JB_ROOT_IS_ARRAY(jbp_)
static Jsonb * DatumGetJsonbP(Datum d)
#define JB_ROOT_IS_SCALAR(jbp_)
Jsonb * JsonbValueToJsonb(JsonbValue *val)
Datum json_populate_type(Datum json_val, Oid json_type, Oid typid, int32 typmod, void **cache, MemoryContext mcxt, bool *isnull, bool omit_quotes, Node *escontext)
JsonTokenType json_get_first_token(text *json, bool throw_error)
static JsonPath * DatumGetJsonPathP(Datum d)
bool JsonPathExists(Datum jb, JsonPath *jp, bool *error, List *vars)
Datum JsonPathQuery(Datum jb, JsonPath *jp, JsonWrapper wrapper, bool *empty, bool *error, List *vars, const char *column_name)
JsonbValue * JsonPathValue(Datum jb, JsonPath *jp, bool *empty, bool *error, List *vars, const char *column_name)
List * lappend(List *list, void *datum)
void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval, char *typalign)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
MemoryContext MemoryContextGetParent(MemoryContext context)
#define AllocSizeIsValid(size)
#define SOFT_ERROR_OCCURRED(escontext)
Datum current_user(PG_FUNCTION_ARGS)
Datum session_user(PG_FUNCTION_ARGS)
Datum current_schema(PG_FUNCTION_ARGS)
Oid exprType(const Node *expr)
void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext)
Datum ExecSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull)
#define IsA(nodeptr, _type_)
#define castNode(_type_, nodeptr)
static Datum NumericGetDatum(Numeric X)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
FormData_pg_attribute * Form_pg_attribute
static uint32 pg_rotate_left32(uint32 word, int n)
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
static char buf[DEFAULT_XLOG_SEG_SIZE]
void pgstat_init_function_usage(FunctionCallInfo fcinfo, PgStat_FunctionCallUsage *fcu)
void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
#define qsort(a, b, c, d)
static uint32 DatumGetUInt32(Datum X)
static Datum Int64GetDatum(int64 X)
static bool DatumGetBool(Datum X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static char * DatumGetCString(Datum X)
static Pointer DatumGetPointer(Datum X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
static Datum UInt32GetDatum(uint32 X)
static int32 DatumGetInt32(Datum X)
#define PointerGetDatum(X)
@ SVFOP_CURRENT_TIMESTAMP
@ SVFOP_CURRENT_TIMESTAMP_N
static chr element(struct vars *v, const chr *startp, const chr *endp)
static unsigned hash(unsigned *uv, int n)
void check_stack_depth(void)
void appendStringInfo(StringInfo str, const char *fmt,...)
void initStringInfo(StringInfo str)
TupleTableSlot * sortslot
Tuplesortstate ** sortstates
TupleTableSlot * uniqslot
FunctionCallInfo transfn_fcinfo
Index es_range_table_size
ParamListInfo ecxt_param_list_info
MemoryContext ecxt_per_tuple_memory
TupleTableSlot * ecxt_innertuple
ParamExecData * ecxt_param_exec_vals
TupleTableSlot * ecxt_newtuple
TupleTableSlot * ecxt_scantuple
TupleTableSlot * ecxt_oldtuple
MemoryContext ecxt_per_query_memory
struct EState * ecxt_estate
TupleTableSlot * ecxt_outertuple
struct ScalarArrayOpExprHashTable * elements_tab
AggStatePerTrans pertrans
struct JsonExprState * jsestate
struct ExprEvalStep::@63::@65 var
FunctionCallInfo fcinfo_data
ErrorSaveContext * escontext
union ExprEvalStep::@63 d
struct ExprEvalStep::@63::@98 hashedscalararrayop
ExprEvalRowtypeCache rowcache
struct JsonConstructorExprState * jcstate
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]
JsonConstructorExpr * constructor
struct JsonConstructorExprState::@113 * arg_type_cache
JsonReturning * returning
FunctionCallInfo input_fcinfo
ErrorSaveContext escontext
NullableDatum formatted_expr
JsonReturning * returning
MergeActionState * mt_merge_action
FunctionCallInfoBaseData hash_fcinfo_data
TupleDesc tts_tupleDescriptor
const TupleTableSlotOps *const tts_ops
uint64 tupDesc_identifier
TupleConversionMap * convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc)
HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map)
void DecrTupleDescRefCount(TupleDesc tupdesc)
void IncrTupleDescRefCount(TupleDesc tupdesc)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
#define ReleaseTupleDesc(tupdesc)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
struct TupleDescData * TupleDesc
void tuplesort_putdatum(Tuplesortstate *state, Datum val, bool isNull)
void tuplesort_puttupleslot(Tuplesortstate *state, TupleTableSlot *slot)
#define att_nominal_alignby(cur_offset, attalignby)
#define att_addlength_pointer(cur_offset, attlen, attptr)
static uint8 typalign_to_alignby(char typalign)
static Datum fetch_att(const void *T, bool attbyval, int attlen)
#define TTS_IS_VIRTUAL(slot)
static void slot_getsomeattrs(TupleTableSlot *slot, int attnum)
static Datum slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static void slot_getallattrs(TupleTableSlot *slot)
static TupleTableSlot * ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
TupleDesc lookup_rowtype_tupdesc_domain(Oid type_id, int32 typmod, bool noError)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
#define TYPECACHE_TUPDESC
static Datum TimestampTzGetDatum(TimestampTz X)
static Datum TimestampGetDatum(Timestamp X)
static bool VARATT_IS_EXTERNAL_EXPANDED(const void *PTR)
static void SET_VARSIZE(void *PTR, Size len)
text * cstring_to_text_with_len(const char *s, int len)
Datum textin(PG_FUNCTION_ARGS)
xmltype * xmlroot(xmltype *data, text *version, int standalone)
text * xmltotext_with_options(xmltype *data, XmlOptionType xmloption_arg, bool indent)
char * map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings)
xmltype * xmlconcat(List *args)
xmltype * xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace, Node *escontext)
bool xml_is_document(xmltype *arg)
xmltype * xmlelement(XmlExpr *xexpr, const Datum *named_argvalue, const bool *named_argnull, const Datum *argvalue, const bool *argnull)
xmltype * xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null)
static xmltype * DatumGetXmlP(Datum X)