88#ifdef HAVE_COMPUTED_GOTO
89#define EEO_USE_COMPUTED_GOTO
102#if defined(EEO_USE_COMPUTED_GOTO)
105typedef struct ExprEvalOpLookup
112static const void **dispatch_table = NULL;
115static ExprEvalOpLookup reverse_dispatch_table[
EEOP_LAST];
118#define EEO_CASE(name) CASE_##name:
119#define EEO_DISPATCH() goto *((void *) op->opcode)
120#define EEO_OPCODE(opcode) ((intptr_t) dispatch_table[opcode])
124#define EEO_SWITCH() starteval: switch ((ExprEvalOp) op->opcode)
125#define EEO_CASE(name) case name:
126#define EEO_DISPATCH() goto starteval
127#define EEO_OPCODE(opcode) (opcode)
137#define EEO_JUMP(stepno) \
139 op = &state->steps[stepno]; \
202#define SH_PREFIX saophash
203#define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
204#define SH_KEY_TYPE Datum
205#define SH_SCOPE static inline
226#define SH_PREFIX saophash
227#define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
228#define SH_KEY_TYPE Datum
230#define SH_HASH_KEY(tb, key) saop_element_hash(tb, key)
231#define SH_EQUAL(tb, a, b) saop_hash_element_match(tb, a, b)
232#define SH_SCOPE static inline
234#define SH_GET_HASH(tb, a) a->hash
283 if (
state->steps_len == 5)
299 else if (
state->steps_len == 4)
327 else if (
state->steps_len == 3)
389 else if (
state->steps_len == 2)
430#if defined(EEO_USE_COMPUTED_GOTO)
436 for (
int off = 0; off <
state->steps_len; off++)
473#if defined(EEO_USE_COMPUTED_GOTO)
474 static const void *
const dispatch_table[] = {
475 &&CASE_EEOP_DONE_RETURN,
476 &&CASE_EEOP_DONE_NO_RETURN,
477 &&CASE_EEOP_INNER_FETCHSOME,
478 &&CASE_EEOP_OUTER_FETCHSOME,
479 &&CASE_EEOP_SCAN_FETCHSOME,
480 &&CASE_EEOP_OLD_FETCHSOME,
481 &&CASE_EEOP_NEW_FETCHSOME,
482 &&CASE_EEOP_INNER_VAR,
483 &&CASE_EEOP_OUTER_VAR,
484 &&CASE_EEOP_SCAN_VAR,
487 &&CASE_EEOP_INNER_SYSVAR,
488 &&CASE_EEOP_OUTER_SYSVAR,
489 &&CASE_EEOP_SCAN_SYSVAR,
490 &&CASE_EEOP_OLD_SYSVAR,
491 &&CASE_EEOP_NEW_SYSVAR,
492 &&CASE_EEOP_WHOLEROW,
493 &&CASE_EEOP_ASSIGN_INNER_VAR,
494 &&CASE_EEOP_ASSIGN_OUTER_VAR,
495 &&CASE_EEOP_ASSIGN_SCAN_VAR,
496 &&CASE_EEOP_ASSIGN_OLD_VAR,
497 &&CASE_EEOP_ASSIGN_NEW_VAR,
498 &&CASE_EEOP_ASSIGN_TMP,
499 &&CASE_EEOP_ASSIGN_TMP_MAKE_RO,
501 &&CASE_EEOP_FUNCEXPR,
502 &&CASE_EEOP_FUNCEXPR_STRICT,
503 &&CASE_EEOP_FUNCEXPR_STRICT_1,
504 &&CASE_EEOP_FUNCEXPR_STRICT_2,
505 &&CASE_EEOP_FUNCEXPR_FUSAGE,
506 &&CASE_EEOP_FUNCEXPR_STRICT_FUSAGE,
507 &&CASE_EEOP_BOOL_AND_STEP_FIRST,
508 &&CASE_EEOP_BOOL_AND_STEP,
509 &&CASE_EEOP_BOOL_AND_STEP_LAST,
510 &&CASE_EEOP_BOOL_OR_STEP_FIRST,
511 &&CASE_EEOP_BOOL_OR_STEP,
512 &&CASE_EEOP_BOOL_OR_STEP_LAST,
513 &&CASE_EEOP_BOOL_NOT_STEP,
516 &&CASE_EEOP_JUMP_IF_NULL,
517 &&CASE_EEOP_JUMP_IF_NOT_NULL,
518 &&CASE_EEOP_JUMP_IF_NOT_TRUE,
519 &&CASE_EEOP_NULLTEST_ISNULL,
520 &&CASE_EEOP_NULLTEST_ISNOTNULL,
521 &&CASE_EEOP_NULLTEST_ROWISNULL,
522 &&CASE_EEOP_NULLTEST_ROWISNOTNULL,
523 &&CASE_EEOP_BOOLTEST_IS_TRUE,
524 &&CASE_EEOP_BOOLTEST_IS_NOT_TRUE,
525 &&CASE_EEOP_BOOLTEST_IS_FALSE,
526 &&CASE_EEOP_BOOLTEST_IS_NOT_FALSE,
527 &&CASE_EEOP_PARAM_EXEC,
528 &&CASE_EEOP_PARAM_EXTERN,
529 &&CASE_EEOP_PARAM_CALLBACK,
530 &&CASE_EEOP_PARAM_SET,
531 &&CASE_EEOP_CASE_TESTVAL,
532 &&CASE_EEOP_CASE_TESTVAL_EXT,
533 &&CASE_EEOP_MAKE_READONLY,
534 &&CASE_EEOP_IOCOERCE,
535 &&CASE_EEOP_IOCOERCE_SAFE,
536 &&CASE_EEOP_DISTINCT,
537 &&CASE_EEOP_NOT_DISTINCT,
539 &&CASE_EEOP_SQLVALUEFUNCTION,
540 &&CASE_EEOP_CURRENTOFEXPR,
541 &&CASE_EEOP_NEXTVALUEEXPR,
542 &&CASE_EEOP_RETURNINGEXPR,
543 &&CASE_EEOP_ARRAYEXPR,
544 &&CASE_EEOP_ARRAYCOERCE,
546 &&CASE_EEOP_ROWCOMPARE_STEP,
547 &&CASE_EEOP_ROWCOMPARE_FINAL,
549 &&CASE_EEOP_FIELDSELECT,
550 &&CASE_EEOP_FIELDSTORE_DEFORM,
551 &&CASE_EEOP_FIELDSTORE_FORM,
552 &&CASE_EEOP_SBSREF_SUBSCRIPTS,
553 &&CASE_EEOP_SBSREF_OLD,
554 &&CASE_EEOP_SBSREF_ASSIGN,
555 &&CASE_EEOP_SBSREF_FETCH,
556 &&CASE_EEOP_DOMAIN_TESTVAL,
557 &&CASE_EEOP_DOMAIN_TESTVAL_EXT,
558 &&CASE_EEOP_DOMAIN_NOTNULL,
559 &&CASE_EEOP_DOMAIN_CHECK,
560 &&CASE_EEOP_HASHDATUM_SET_INITVAL,
561 &&CASE_EEOP_HASHDATUM_FIRST,
562 &&CASE_EEOP_HASHDATUM_FIRST_STRICT,
563 &&CASE_EEOP_HASHDATUM_NEXT32,
564 &&CASE_EEOP_HASHDATUM_NEXT32_STRICT,
565 &&CASE_EEOP_CONVERT_ROWTYPE,
566 &&CASE_EEOP_SCALARARRAYOP,
567 &&CASE_EEOP_HASHED_SCALARARRAYOP,
569 &&CASE_EEOP_JSON_CONSTRUCTOR,
571 &&CASE_EEOP_JSONEXPR_PATH,
572 &&CASE_EEOP_JSONEXPR_COERCION,
573 &&CASE_EEOP_JSONEXPR_COERCION_FINISH,
575 &&CASE_EEOP_GROUPING_FUNC,
576 &&CASE_EEOP_WINDOW_FUNC,
577 &&CASE_EEOP_MERGE_SUPPORT_FUNC,
579 &&CASE_EEOP_AGG_STRICT_DESERIALIZE,
580 &&CASE_EEOP_AGG_DESERIALIZE,
581 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_ARGS,
582 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_ARGS_1,
583 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_NULLS,
584 &&CASE_EEOP_AGG_PLAIN_PERGROUP_NULLCHECK,
585 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL,
586 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL,
587 &&CASE_EEOP_AGG_PLAIN_TRANS_BYVAL,
588 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF,
589 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYREF,
590 &&CASE_EEOP_AGG_PLAIN_TRANS_BYREF,
591 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_SINGLE,
592 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_MULTI,
593 &&CASE_EEOP_AGG_ORDERED_TRANS_DATUM,
594 &&CASE_EEOP_AGG_ORDERED_TRANS_TUPLE,
599 "dispatch_table out of whack with ExprEvalOp");
609 resultslot =
state->resultslot;
616#if defined(EEO_USE_COMPUTED_GOTO)
625 return state->resvalue;
789 int attnum =
op->d.assign_var.attnum;
796 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
806 int attnum =
op->d.assign_var.attnum;
813 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
823 int attnum =
op->d.assign_var.attnum;
830 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
840 int attnum =
op->d.assign_var.attnum;
847 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
857 int attnum =
op->d.assign_var.attnum;
864 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
875 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
886 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
899 *
op->resnull =
op->d.constval.isnull;
900 *
op->resvalue =
op->d.constval.value;
926 d =
op->d.func.fn_addr(fcinfo);
944 for (
int argno = 0; argno <
nargs; argno++)
953 d =
op->d.func.fn_addr(fcinfo);
977 d =
op->d.func.fn_addr(fcinfo);
1001 d =
op->d.func.fn_addr(fcinfo);
1037 *
op->d.boolexpr.anynull =
false;
1051 *
op->d.boolexpr.anynull =
true;
1079 else if (*
op->d.boolexpr.anynull)
1082 *
op->resnull =
true;
1104 *
op->d.boolexpr.anynull =
false;
1118 *
op->d.boolexpr.anynull =
true;
1146 else if (*
op->d.boolexpr.anynull)
1149 *
op->resnull =
true;
1181 *
op->resnull =
false;
1230 *
op->resnull =
false;
1238 *
op->resnull =
false;
1266 *
op->resnull =
false;
1278 *
op->resnull =
false;
1291 *
op->resnull =
false;
1304 *
op->resnull =
false;
1329 op->d.cparam.paramfunc(
state,
op, econtext);
1342 *
op->resvalue = *
op->d.casetest.value;
1343 *
op->resnull = *
op->d.casetest.isnull;
1361 if (!*
op->d.make_readonly.isnull)
1364 *
op->resnull = *
op->d.make_readonly.isnull;
1391 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
1395 fcinfo_out->
isnull =
false;
1403 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
1408 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
1413 fcinfo_in->
isnull =
false;
1457 *
op->resnull =
false;
1463 *
op->resnull =
false;
1471 eqresult =
op->d.func.fn_addr(fcinfo);
1488 *
op->resnull =
false;
1493 *
op->resnull =
false;
1500 eqresult =
op->d.func.fn_addr(fcinfo);
1501 *
op->resvalue = eqresult;
1528 if (
op->d.func.make_ro)
1533 result =
op->d.func.fn_addr(fcinfo);
1539 *
op->resnull =
true;
1546 *
op->resvalue = save_arg0;
1588 if (
state->flags &
op->d.returningexpr.nullflag)
1591 *
op->resnull =
true;
1629 if (
op->d.rowcompare_step.finfo->fn_strict &&
1632 *
op->resnull =
true;
1638 d =
op->d.rowcompare_step.fn_addr(fcinfo);
1644 *
op->resnull =
true;
1647 *
op->resnull =
false;
1663 *
op->resnull =
false;
1722 if (
op->d.sbsref_subscript.subscriptfunc(
state,
op, econtext))
1738 op->d.sbsref.subscriptfunc(
state,
op, econtext);
1769 *
op->resvalue = *
op->d.casetest.value;
1770 *
op->resnull = *
op->d.casetest.isnull;
1801 *
op->resvalue =
op->d.hashdatum_initvalue.init_value;
1802 *
op->resnull =
false;
1816 *
op->resvalue =
op->d.hashdatum.fn_addr(fcinfo);
1820 *
op->resnull =
false;
1836 *
op->resnull =
true;
1842 *
op->resvalue =
op->d.hashdatum.fn_addr(fcinfo);
1843 *
op->resnull =
false;
1864 existinghash = existinghash ^ hashvalue;
1868 *
op->resnull =
false;
1884 *
op->resnull =
true;
1900 *
op->resnull =
false;
1957 int aggno =
op->d.aggref.aggno;
2010 if (
op->d.agg_deserialize.fcinfo_data->args[0].isnull)
2045 int nargs =
op->d.agg_strict_input_check.nargs;
2049 for (
int argno = 0; argno <
nargs; argno++)
2052 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2066 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2072 bool *
nulls =
op->d.agg_strict_input_check.nulls;
2073 int nargs =
op->d.agg_strict_input_check.nargs;
2075 for (
int argno = 0; argno <
nargs; argno++)
2078 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2093 if (pergroup_allaggs == NULL)
2094 EEO_JUMP(
op->d.agg_plain_pergroup_nullcheck.jumpnull);
2124 op->d.agg_trans.aggcontext);
2131 op->d.agg_trans.aggcontext,
2132 op->d.agg_trans.setno);
2150 op->d.agg_trans.aggcontext,
2151 op->d.agg_trans.setno);
2167 op->d.agg_trans.aggcontext,
2168 op->d.agg_trans.setno);
2185 op->d.agg_trans.aggcontext);
2188 op->d.agg_trans.aggcontext,
2189 op->d.agg_trans.setno);
2206 op->d.agg_trans.aggcontext,
2207 op->d.agg_trans.setno);
2222 op->d.agg_trans.aggcontext,
2223 op->d.agg_trans.setno);
2236 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
2247 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
2299 return state->evalfunc(
state, econtext, isNull);
2321 for (
int i = 0;
i <
state->steps_len;
i++)
2403 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
2409 if (attr->attgenerated == ATTRIBUTE_GENERATED_VIRTUAL)
2410 elog(
ERROR,
"unexpected virtual generated column reference");
2412 if (attr->attisdropped)
2414 (
errcode(ERRCODE_UNDEFINED_COLUMN),
2415 errmsg(
"attribute %d of type %s has been dropped",
2418 if (
vartype != attr->atttypid)
2420 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2421 errmsg(
"attribute %d of type %s has wrong type",
2423 errdetail(
"Table has type %s, but query expects %s.",
2435#ifdef USE_ASSERT_CHECKING
2437 if (!
op->d.fetch.fixed)
2484 if (type_id != RECORDOID)
2500 if (typentry->
tupDesc == NULL)
2502 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
2503 errmsg(
"type %s is not composite",
2587 int attnum =
op->d.assign_var.attnum + 1;
2602 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2643 *
op->resvalue = *
op->d.casetest.value;
2644 *
op->resnull = *
op->d.casetest.isnull;
2649 fcinfo =
op->d.func.fcinfo_data;
2653 for (
int argno = 0; argno <
nargs; argno++)
2662 d =
op->d.func.fn_addr(fcinfo);
2674 return op->d.constval.value;
2725 int attnum =
op->d.assign_var.attnum;
2734 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2792 hashkey = hashkey ^ hashvalue;
2905#if defined(EEO_USE_COMPUTED_GOTO)
2911dispatch_compare_ptr(
const void *
a,
const void *
b)
2913 const ExprEvalOpLookup *la = (
const ExprEvalOpLookup *)
a;
2914 const ExprEvalOpLookup *lb = (
const ExprEvalOpLookup *)
b;
2916 if (la->opcode < lb->opcode)
2918 else if (la->opcode > lb->opcode)
2930#if defined(EEO_USE_COMPUTED_GOTO)
2932 if (dispatch_table == NULL)
2934 dispatch_table = (
const void **)
2940 reverse_dispatch_table[
i].opcode = dispatch_table[
i];
2945 qsort(reverse_dispatch_table,
2947 sizeof(ExprEvalOpLookup),
2948 dispatch_compare_ptr);
2962#if defined(EEO_USE_COMPUTED_GOTO)
2965 ExprEvalOpLookup
key;
2966 ExprEvalOpLookup *res;
2968 key.opcode = (
void *)
op->opcode;
2970 reverse_dispatch_table,
2972 sizeof(ExprEvalOpLookup),
2973 dispatch_compare_ptr);
3000 d =
op->d.func.fn_addr(fcinfo);
3022 for (
int argno = 0; argno <
nargs; argno++)
3026 *
op->resnull =
true;
3034 d =
op->d.func.fn_addr(fcinfo);
3073 int paramId =
op->d.param.paramid;
3076 paramId > 0 && paramId <= paramInfo->numParams))
3083 prm = paramInfo->
paramFetch(paramInfo, paramId,
false, &prmdata);
3085 prm = ¶mInfo->
params[paramId - 1];
3092 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3093 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
3104 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3105 errmsg(
"no value found for parameter %d", paramId)));
3149 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
3153 fcinfo_out->
isnull =
false;
3161 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
3165 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
3173 fcinfo_in->
isnull =
false;
3178 *
op->resnull =
true;
3200 *
op->resnull =
false;
3232 *
op->resnull = fcinfo->isnull;
3237 *
op->resnull = fcinfo->isnull;
3242 *
op->resnull = fcinfo->isnull;
3247 *
op->resnull = fcinfo->isnull;
3265 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3266 errmsg(
"WHERE CURRENT OF is not supported for this table type")));
3277 switch (
op->d.nextvalueexpr.seqtypid)
3289 elog(
ERROR,
"unsupported sequence type %u",
3290 op->d.nextvalueexpr.seqtypid);
3292 *
op->resnull =
false;
3326 *
op->resnull =
false;
3358 &
op->d.nulltest_row.rowcache, NULL);
3366 for (
int att = 1; att <= tupDesc->
natts; att++)
3405 int nelems =
op->d.arrayexpr.nelems;
3411 *
op->resnull =
false;
3413 if (!
op->d.arrayexpr.multidims)
3416 Datum *dvalues =
op->d.arrayexpr.elemvalues;
3417 bool *dnulls =
op->d.arrayexpr.elemnulls;
3426 op->d.arrayexpr.elemlength,
3427 op->d.arrayexpr.elembyval,
3428 op->d.arrayexpr.elemalign);
3435 int outer_nelems = 0;
3437 int *elem_dims = NULL;
3438 int *elem_lbs = NULL;
3439 bool firstone =
true;
3440 bool havenulls =
false;
3441 bool haveempty =
false;
3456 for (
int elemoff = 0; elemoff <
nelems; elemoff++)
3463 arraydatum =
op->d.arrayexpr.elemvalues[elemoff];
3464 eisnull =
op->d.arrayexpr.elemnulls[elemoff];
3478 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3479 errmsg(
"cannot merge incompatible arrays"),
3480 errdetail(
"Array with element type %s cannot be "
3481 "included in ARRAY construct with element type %s.",
3487 if (this_ndims <= 0)
3496 elem_ndims = this_ndims;
3497 ndims = elem_ndims + 1;
3498 if (ndims <= 0 || ndims >
MAXDIM)
3500 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3501 errmsg(
"number of array dimensions (%d) exceeds the maximum allowed (%d)",
3504 elem_dims = (
int *)
palloc(elem_ndims *
sizeof(
int));
3505 memcpy(elem_dims,
ARR_DIMS(array), elem_ndims *
sizeof(
int));
3506 elem_lbs = (
int *)
palloc(elem_ndims *
sizeof(
int));
3507 memcpy(elem_lbs,
ARR_LBOUND(array), elem_ndims *
sizeof(
int));
3514 if (elem_ndims != this_ndims ||
3516 elem_ndims *
sizeof(
int)) != 0 ||
3518 elem_ndims *
sizeof(
int)) != 0)
3520 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
3521 errmsg(
"multidimensional arrays must have array "
3522 "expressions with matching dimensions")));
3528 nbytes += subbytes[outer_nelems];
3532 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3533 errmsg(
"array size exceeds the maximum allowed (%d)",
3555 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
3556 errmsg(
"multidimensional arrays must have array "
3557 "expressions with matching dimensions")));
3561 dims[0] = outer_nelems;
3563 for (
int i = 1;
i < ndims;
i++)
3565 dims[
i] = elem_dims[
i - 1];
3566 lbs[
i] = elem_lbs[
i - 1];
3576 nbytes += dataoffset;
3586 result->
ndim = ndims;
3589 memcpy(
ARR_DIMS(result), dims, ndims *
sizeof(
int));
3590 memcpy(
ARR_LBOUND(result), lbs, ndims *
sizeof(
int));
3594 for (
int i = 0;
i < outer_nelems;
i++)
3596 memcpy(dat, subdata[
i], subbytes[
i]);
3602 iitem += subnitems[
i];
3623 arraydatum = *
op->resvalue;
3629 if (
op->d.arraycoerce.elemexprstate == NULL)
3643 op->d.arraycoerce.elemexprstate,
3645 op->d.arraycoerce.resultelemtype,
3646 op->d.arraycoerce.amstate);
3662 op->d.row.elemvalues,
3663 op->d.row.elemnulls);
3666 *
op->resnull =
false;
3679 bool *
nulls =
op->d.minmax.nulls;
3688 *
op->resnull =
true;
3690 for (
int off = 0; off <
op->d.minmax.nelems; off++)
3700 *
op->resnull =
false;
3715 if (cmpresult > 0 &&
operator ==
IS_LEAST)
3717 else if (cmpresult < 0 &&
operator ==
IS_GREATEST)
3744 tupDatum = *
op->resvalue;
3762 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3765 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3770 if (attr->attisdropped)
3772 *
op->resnull =
true;
3778 if (
op->d.fieldselect.resulttype != attr->atttypid)
3780 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3782 errdetail(
"Table has type %s, but query expects %s.",
3800 &
op->d.fieldselect.rowcache, NULL);
3808 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3811 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3816 if (attr->attisdropped)
3818 *
op->resnull =
true;
3824 if (
op->d.fieldselect.resulttype != attr->atttypid)
3826 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3828 errdetail(
"Table has type %s, but query expects %s.",
3859 memset(
op->d.fieldstore.nulls,
true,
3860 op->d.fieldstore.ncolumns *
sizeof(
bool));
3868 Datum tupDatum = *
op->resvalue;
3886 op->d.fieldstore.rowcache, NULL);
3890 elog(
ERROR,
"too many columns in composite type %u",
3891 op->d.fieldstore.fstore->resulttype);
3894 op->d.fieldstore.values,
3895 op->d.fieldstore.nulls);
3911 op->d.fieldstore.rowcache, NULL);
3914 op->d.fieldstore.values,
3915 op->d.fieldstore.nulls);
3918 *
op->resnull =
false;
3936 bool changed =
false;
3942 tupDatum = *
op->resvalue;
3951 op->d.convert_rowtype.incache,
3955 op->d.convert_rowtype.outcache,
3986 if (
op->d.convert_rowtype.map != NULL)
4026 bool useOr =
op->d.scalararrayop.useOr;
4027 bool strictfunc =
op->d.scalararrayop.finfo->fn_strict;
4059 *
op->resnull =
false;
4069 *
op->resnull =
true;
4080 &
op->d.scalararrayop.typlen,
4081 &
op->d.scalararrayop.typbyval,
4082 &
op->d.scalararrayop.typalign);
4086 typlen =
op->d.scalararrayop.typlen;
4105 if (bitmap && (*bitmap & bitmask) == 0)
4123 thisresult = (
Datum) 0;
4128 thisresult =
op->d.scalararrayop.fn_addr(fcinfo);
4157 if (bitmask == 0x100)
4165 *
op->resvalue = result;
4166 *
op->resnull = resultnull;
4182 fcinfo->args[0].value =
key;
4183 fcinfo->args[0].isnull =
false;
4203 fcinfo->args[0].isnull =
false;
4204 fcinfo->args[1].value = key2;
4205 fcinfo->args[1].isnull =
false;
4230 bool inclause =
op->d.hashedscalararrayop.inclause;
4231 bool strictfunc =
op->d.hashedscalararrayop.finfo->fn_strict;
4247 *
op->resnull =
true;
4266 saop =
op->d.hashedscalararrayop.saop;
4311 if (bitmap && (*bitmap & bitmask) == 0)
4330 if (bitmask == 0x100)
4362 if (!hashfound &&
op->d.hashedscalararrayop.has_nulls)
4388 result =
op->d.hashedscalararrayop.finfo->fn_addr(fcinfo);
4389 resultnull = fcinfo->
isnull;
4400 *
op->resvalue = result;
4401 *
op->resnull = resultnull;
4412 (
errcode(ERRCODE_NOT_NULL_VIOLATION),
4413 errmsg(
"domain %s does not allow null values",
4424 if (!*
op->d.domaincheck.checknull &&
4427 (
errcode(ERRCODE_CHECK_VIOLATION),
4428 errmsg(
"value for domain %s violates check constraint \"%s\"",
4430 op->d.domaincheck.constraintname),
4432 op->d.domaincheck.constraintname)));
4447 *
op->resnull =
true;
4467 *
op->resnull =
false;
4475 bool *
argnull =
op->d.xmlexpr.named_argnull;
4497 *
op->resnull =
false;
4516 op->d.xmlexpr.named_argvalue,
4517 op->d.xmlexpr.named_argnull,
4518 op->d.xmlexpr.argvalue,
4519 op->d.xmlexpr.argnull));
4520 *
op->resnull =
false;
4528 bool preserve_whitespace;
4545 preserve_whitespace));
4546 *
op->resnull =
false;
4605 *
op->resnull =
false;
4625 *
op->resnull =
false;
4643 *
op->resnull =
false;
4648 elog(
ERROR,
"unrecognized XML operation");
4725 elog(
ERROR,
"invalid JsonConstructorExpr type %d", ctor->
type);
4727 *
op->resvalue = res;
4750 if (exprtype == TEXTOID || exprtype == JSONOID)
4786 else if (exprtype == JSONBOID)
4868 !throw_error ? &
error : NULL,
4873 *
op->resnull =
false;
4881 !throw_error ? &
error : NULL,
4891 !throw_error ? &
error : NULL,
4899 *
op->resnull =
true;
4901 else if (!
error && !empty)
4912 *
op->resnull =
false;
4933 elog(
ERROR,
"unrecognized SQL/JSON expression op %d",
4946 Assert(jump_eval_coercion == -1);
4976 *
op->resnull =
true;
5002 errcode(ERRCODE_NO_SQL_JSON_ITEM),
5003 errmsg(
"no SQL/JSON item found for specified path of column \"%s\"",
5007 errcode(ERRCODE_NO_SQL_JSON_ITEM),
5008 errmsg(
"no SQL/JSON item found for specified path"));
5019 *
op->resnull =
true;
5052 memcpy(
str, item->
val.string.val, item->
val.string.len);
5053 str[item->
val.string.len] =
'\0';
5066 switch (item->
val.datetime.typid)
5070 item->
val.datetime.value));
5073 item->
val.datetime.value));
5076 item->
val.datetime.value));
5079 item->
val.datetime.value));
5080 case TIMESTAMPTZOID:
5082 item->
val.datetime.value));
5084 elog(
ERROR,
"unexpected jsonb datetime type oid %u",
5085 item->
val.datetime.typid);
5127 if (
op->d.jsonexpr_coercion.exists_coerce)
5129 if (
op->d.jsonexpr_coercion.exists_cast_to_int)
5132 if (
op->d.jsonexpr_coercion.exists_check_domain &&
5134 op->d.jsonexpr_coercion.targettype,
5135 &
op->d.jsonexpr_coercion.json_coercion_cache,
5139 *
op->resnull =
true;
5154 op->d.jsonexpr_coercion.targettype,
5155 op->d.jsonexpr_coercion.targettypmod,
5156 &
op->d.jsonexpr_coercion.json_coercion_cache,
5159 op->d.jsonexpr_coercion.omit_quotes,
5170 const char *behavior_names[] =
5206 (
errcode(ERRCODE_DATATYPE_MISMATCH),
5208 errmsg(
"could not coerce %s expression (%s) to the RETURNING type",
5214 (
errcode(ERRCODE_DATATYPE_MISMATCH),
5216 errmsg(
"could not coerce %s expression (%s) to the RETURNING type",
5222 *
op->resnull =
true;
5253 foreach(lc,
op->d.grouping_func.clauses)
5264 *
op->resnull =
false;
5280 elog(
ERROR,
"no merge action in progress");
5287 *
op->resnull =
false;
5291 *
op->resnull =
false;
5295 *
op->resnull =
false;
5298 elog(
ERROR,
"unexpected merge action: DO NOTHING");
5301 elog(
ERROR,
"unrecognized commandType: %d",
5363 switch (
variable->varreturningtype)
5373 *
op->resnull =
true;
5383 *
op->resnull =
true;
5393 if (
op->d.wholerow.junkFilter != NULL)
5403 if (
op->d.wholerow.first)
5406 op->d.wholerow.slow =
false;
5412 if (
variable->vartype != RECORDOID)
5437 if (var_tupdesc->
natts != slot_tupdesc->
natts)
5439 (
errcode(ERRCODE_DATATYPE_MISMATCH),
5440 errmsg(
"table row type and query-specified row type do not match"),
5442 "Table row contains %d attributes, but query expects %d.",
5443 slot_tupdesc->
natts,
5444 slot_tupdesc->
natts,
5445 var_tupdesc->
natts)));
5447 for (
int i = 0;
i < var_tupdesc->
natts;
i++)
5452 if (vattr->atttypid == sattr->atttypid)
5454 if (!vattr->attisdropped)
5456 (
errcode(ERRCODE_DATATYPE_MISMATCH),
5457 errmsg(
"table row type and query-specified row type do not match"),
5458 errdetail(
"Table has type %s at ordinal position %d, but query expects %s.",
5463 if (vattr->attlen != sattr->attlen ||
5464 vattr->attalign != sattr->attalign)
5465 op->d.wholerow.slow =
true;
5495 output_tupdesc->
tdtypeid = RECORDOID;
5526 op->d.wholerow.first =
false;
5535 if (
op->d.wholerow.slow)
5543 for (
int i = 0;
i < var_tupdesc->
natts;
i++)
5555 (
errcode(ERRCODE_DATATYPE_MISMATCH),
5556 errmsg(
"table row type and query-specified row type do not match"),
5557 errdetail(
"Physical storage mismatch on dropped attribute at ordinal position %d.",
5582 *
op->resnull =
false;
5598 *
op->resnull =
true;
5609 elog(
ERROR,
"failed to fetch attribute from slot");
5671 Datum newValue,
bool newValueIsNull,
5672 Datum oldValue,
bool oldValueIsNull)
5674 Assert(newValue != oldValue);
5676 if (!newValueIsNull)
5696 newValue = (
Datum) 0;
5699 if (!oldValueIsNull)
5765 bool isdistinct =
false;
5813 int setno =
op->d.agg_trans.setno;
5816 *
op->resvalue, *
op->resnull);
5827 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)
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)
void array_bitmap_copy(bits8 *destbitmap, int destoffset, const bits8 *srcbitmap, int srcoffset, int nitems)
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 pg_attribute_always_inline
#define StaticAssertDecl(condition, errmessage)
#define OidIsValid(objectId)
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 errdetail(const char *fmt,...)
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define errsave(context,...)
#define ereport(elevel,...)
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)
struct ScalarArrayOpExprHashEntry ScalarArrayOpExprHashEntry
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)
struct ScalarArrayOpExprHashTable ScalarArrayOpExprHashTable
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 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
#define EEO_FLAG_NEW_IS_NULL
#define EEO_FLAG_OLD_IS_NULL
Datum(* ExprStateEvalFunc)(struct ExprState *expression, struct ExprContext *econtext, bool *isNull)
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)
Datum Int64GetDatum(int64 X)
#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)
Assert(PointerIsAligned(start, uint64))
HeapTuple toast_build_flattened_tuple(TupleDesc tupleDesc, Datum *values, 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)
if(TABLE==NULL||TABLE_index==NULL)
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)
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 bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *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)
@ 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
AggStatePerGroup * all_pergroups
ExprContext * curaggcontext
AggStatePerTrans curpertrans
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 ExprEvalStep::@55::@90 hashedscalararrayop
struct ExprEvalStep::@55::@57 var
struct ScalarArrayOpExprHashTable * elements_tab
AggStatePerTrans pertrans
struct JsonExprState * jsestate
struct ExprEvalStep::@55::@86 hashdatum_initvalue
FunctionCallInfo fcinfo_data
ErrorSaveContext * escontext
union ExprEvalStep::@55 d
struct ExprEvalStep::@55::@87 hashdatum
ExprEvalRowtypeCache rowcache
struct JsonConstructorExprState * jcstate
struct ExprEvalStep::@55::@56 fetch
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]
JsonConstructorExpr * constructor
struct JsonConstructorExprState::@105 * arg_type_cache
JsonReturning * returning
FunctionCallInfo input_fcinfo
ErrorSaveContext escontext
NullableDatum formatted_expr
JsonReturning * returning
MergeActionState * mt_merge_action
ParamExternData params[FLEXIBLE_ARRAY_MEMBER]
ParamFetchHook paramFetch
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_align_nominal(cur_offset, attalign)
#define att_addlength_pointer(cur_offset, attlen, attptr)
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)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
#define SET_VARSIZE(PTR, 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)
bool xml_is_document(xmltype *arg)
xmltype * xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace)
xmltype * xmlelement(XmlExpr *xexpr, Datum *named_argvalue, bool *named_argnull, Datum *argvalue, bool *argnull)
xmltype * xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null)
static xmltype * DatumGetXmlP(Datum X)