88 #ifdef HAVE_COMPUTED_GOTO
89 #define EEO_USE_COMPUTED_GOTO
102 #if defined(EEO_USE_COMPUTED_GOTO)
105 typedef struct ExprEvalOpLookup
112 static const void **dispatch_table = NULL;
115 static 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]; \
196 #define SH_PREFIX saophash
197 #define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
198 #define SH_KEY_TYPE Datum
199 #define SH_SCOPE static inline
220 #define SH_PREFIX saophash
221 #define SH_ELEMENT_TYPE ScalarArrayOpExprHashEntry
222 #define SH_KEY_TYPE Datum
224 #define SH_HASH_KEY(tb, key) saop_element_hash(tb, key)
225 #define SH_EQUAL(tb, a, b) saop_hash_element_match(tb, a, b)
226 #define SH_SCOPE static inline
227 #define SH_STORE_HASH
228 #define SH_GET_HASH(tb, a) a->hash
276 if (
state->steps_len == 3)
319 state->steps[0].d.casetest.value)
325 else if (
state->steps_len == 2)
366 #if defined(EEO_USE_COMPUTED_GOTO)
372 for (
int off = 0; off <
state->steps_len; off++)
407 #if defined(EEO_USE_COMPUTED_GOTO)
408 static const void *
const dispatch_table[] = {
410 &&CASE_EEOP_INNER_FETCHSOME,
411 &&CASE_EEOP_OUTER_FETCHSOME,
412 &&CASE_EEOP_SCAN_FETCHSOME,
413 &&CASE_EEOP_INNER_VAR,
414 &&CASE_EEOP_OUTER_VAR,
415 &&CASE_EEOP_SCAN_VAR,
416 &&CASE_EEOP_INNER_SYSVAR,
417 &&CASE_EEOP_OUTER_SYSVAR,
418 &&CASE_EEOP_SCAN_SYSVAR,
419 &&CASE_EEOP_WHOLEROW,
420 &&CASE_EEOP_ASSIGN_INNER_VAR,
421 &&CASE_EEOP_ASSIGN_OUTER_VAR,
422 &&CASE_EEOP_ASSIGN_SCAN_VAR,
423 &&CASE_EEOP_ASSIGN_TMP,
424 &&CASE_EEOP_ASSIGN_TMP_MAKE_RO,
426 &&CASE_EEOP_FUNCEXPR,
427 &&CASE_EEOP_FUNCEXPR_STRICT,
428 &&CASE_EEOP_FUNCEXPR_FUSAGE,
429 &&CASE_EEOP_FUNCEXPR_STRICT_FUSAGE,
430 &&CASE_EEOP_BOOL_AND_STEP_FIRST,
431 &&CASE_EEOP_BOOL_AND_STEP,
432 &&CASE_EEOP_BOOL_AND_STEP_LAST,
433 &&CASE_EEOP_BOOL_OR_STEP_FIRST,
434 &&CASE_EEOP_BOOL_OR_STEP,
435 &&CASE_EEOP_BOOL_OR_STEP_LAST,
436 &&CASE_EEOP_BOOL_NOT_STEP,
439 &&CASE_EEOP_JUMP_IF_NULL,
440 &&CASE_EEOP_JUMP_IF_NOT_NULL,
441 &&CASE_EEOP_JUMP_IF_NOT_TRUE,
442 &&CASE_EEOP_NULLTEST_ISNULL,
443 &&CASE_EEOP_NULLTEST_ISNOTNULL,
444 &&CASE_EEOP_NULLTEST_ROWISNULL,
445 &&CASE_EEOP_NULLTEST_ROWISNOTNULL,
446 &&CASE_EEOP_BOOLTEST_IS_TRUE,
447 &&CASE_EEOP_BOOLTEST_IS_NOT_TRUE,
448 &&CASE_EEOP_BOOLTEST_IS_FALSE,
449 &&CASE_EEOP_BOOLTEST_IS_NOT_FALSE,
450 &&CASE_EEOP_PARAM_EXEC,
451 &&CASE_EEOP_PARAM_EXTERN,
452 &&CASE_EEOP_PARAM_CALLBACK,
453 &&CASE_EEOP_CASE_TESTVAL,
454 &&CASE_EEOP_MAKE_READONLY,
455 &&CASE_EEOP_IOCOERCE,
456 &&CASE_EEOP_IOCOERCE_SAFE,
457 &&CASE_EEOP_DISTINCT,
458 &&CASE_EEOP_NOT_DISTINCT,
460 &&CASE_EEOP_SQLVALUEFUNCTION,
461 &&CASE_EEOP_CURRENTOFEXPR,
462 &&CASE_EEOP_NEXTVALUEEXPR,
463 &&CASE_EEOP_ARRAYEXPR,
464 &&CASE_EEOP_ARRAYCOERCE,
466 &&CASE_EEOP_ROWCOMPARE_STEP,
467 &&CASE_EEOP_ROWCOMPARE_FINAL,
469 &&CASE_EEOP_FIELDSELECT,
470 &&CASE_EEOP_FIELDSTORE_DEFORM,
471 &&CASE_EEOP_FIELDSTORE_FORM,
472 &&CASE_EEOP_SBSREF_SUBSCRIPTS,
473 &&CASE_EEOP_SBSREF_OLD,
474 &&CASE_EEOP_SBSREF_ASSIGN,
475 &&CASE_EEOP_SBSREF_FETCH,
476 &&CASE_EEOP_DOMAIN_TESTVAL,
477 &&CASE_EEOP_DOMAIN_NOTNULL,
478 &&CASE_EEOP_DOMAIN_CHECK,
479 &&CASE_EEOP_CONVERT_ROWTYPE,
480 &&CASE_EEOP_SCALARARRAYOP,
481 &&CASE_EEOP_HASHED_SCALARARRAYOP,
483 &&CASE_EEOP_JSON_CONSTRUCTOR,
485 &&CASE_EEOP_JSONEXPR_PATH,
486 &&CASE_EEOP_JSONEXPR_COERCION,
487 &&CASE_EEOP_JSONEXPR_COERCION_FINISH,
489 &&CASE_EEOP_GROUPING_FUNC,
490 &&CASE_EEOP_WINDOW_FUNC,
491 &&CASE_EEOP_MERGE_SUPPORT_FUNC,
493 &&CASE_EEOP_AGG_STRICT_DESERIALIZE,
494 &&CASE_EEOP_AGG_DESERIALIZE,
495 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_ARGS,
496 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_NULLS,
497 &&CASE_EEOP_AGG_PLAIN_PERGROUP_NULLCHECK,
498 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL,
499 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL,
500 &&CASE_EEOP_AGG_PLAIN_TRANS_BYVAL,
501 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF,
502 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYREF,
503 &&CASE_EEOP_AGG_PLAIN_TRANS_BYREF,
504 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_SINGLE,
505 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_MULTI,
506 &&CASE_EEOP_AGG_ORDERED_TRANS_DATUM,
507 &&CASE_EEOP_AGG_ORDERED_TRANS_TUPLE,
512 "dispatch_table out of whack with ExprEvalOp");
522 resultslot =
state->resultslot;
527 #if defined(EEO_USE_COMPUTED_GOTO)
637 int attnum =
op->d.assign_var.attnum;
644 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
654 int attnum =
op->d.assign_var.attnum;
661 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
671 int attnum =
op->d.assign_var.attnum;
678 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
689 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
700 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
713 *
op->resnull =
op->d.constval.isnull;
714 *
op->resvalue =
op->d.constval.value;
740 d =
op->d.func.fn_addr(fcinfo);
755 for (
int argno = 0; argno <
nargs; argno++)
764 d =
op->d.func.fn_addr(fcinfo);
800 *
op->d.boolexpr.anynull =
false;
814 *
op->d.boolexpr.anynull =
true;
842 else if (*
op->d.boolexpr.anynull)
867 *
op->d.boolexpr.anynull =
false;
881 *
op->d.boolexpr.anynull =
true;
909 else if (*
op->d.boolexpr.anynull)
944 *
op->resnull =
false;
993 *
op->resnull =
false;
1001 *
op->resnull =
false;
1029 *
op->resnull =
false;
1041 *
op->resnull =
false;
1054 *
op->resnull =
false;
1067 *
op->resnull =
false;
1092 op->d.cparam.paramfunc(
state,
op, econtext);
1107 if (
op->d.casetest.value)
1109 *
op->resvalue = *
op->d.casetest.value;
1110 *
op->resnull = *
op->d.casetest.isnull;
1126 if (
op->d.casetest.value)
1128 *
op->resvalue = *
op->d.casetest.value;
1129 *
op->resnull = *
op->d.casetest.isnull;
1145 if (!*
op->d.make_readonly.isnull)
1148 *
op->resnull = *
op->d.make_readonly.isnull;
1175 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
1179 fcinfo_out->
isnull =
false;
1187 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
1192 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
1197 fcinfo_in->
isnull =
false;
1241 *
op->resnull =
false;
1247 *
op->resnull =
false;
1255 eqresult =
op->d.func.fn_addr(fcinfo);
1272 *
op->resnull =
false;
1277 *
op->resnull =
false;
1284 eqresult =
op->d.func.fn_addr(fcinfo);
1285 *
op->resvalue = eqresult;
1305 result =
op->d.func.fn_addr(fcinfo);
1311 *
op->resnull =
true;
1384 if (
op->d.rowcompare_step.finfo->fn_strict &&
1387 *
op->resnull =
true;
1393 d =
op->d.rowcompare_step.fn_addr(fcinfo);
1399 *
op->resnull =
true;
1402 *
op->resnull =
false;
1418 *
op->resnull =
false;
1477 if (
op->d.sbsref_subscript.subscriptfunc(
state,
op, econtext))
1493 op->d.sbsref.subscriptfunc(
state,
op, econtext);
1589 int aggno =
op->d.aggref.aggno;
1642 if (
op->d.agg_deserialize.fcinfo_data->args[0].isnull)
1676 int nargs =
op->d.agg_strict_input_check.nargs;
1678 for (
int argno = 0; argno <
nargs; argno++)
1681 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
1688 bool *
nulls =
op->d.agg_strict_input_check.nulls;
1689 int nargs =
op->d.agg_strict_input_check.nargs;
1691 for (
int argno = 0; argno <
nargs; argno++)
1694 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
1709 if (pergroup_allaggs == NULL)
1710 EEO_JUMP(
op->d.agg_plain_pergroup_nullcheck.jumpnull);
1740 op->d.agg_trans.aggcontext);
1747 op->d.agg_trans.aggcontext,
1748 op->d.agg_trans.setno);
1766 op->d.agg_trans.aggcontext,
1767 op->d.agg_trans.setno);
1783 op->d.agg_trans.aggcontext,
1784 op->d.agg_trans.setno);
1801 op->d.agg_trans.aggcontext);
1804 op->d.agg_trans.aggcontext,
1805 op->d.agg_trans.setno);
1822 op->d.agg_trans.aggcontext,
1823 op->d.agg_trans.setno);
1838 op->d.agg_trans.aggcontext,
1839 op->d.agg_trans.setno);
1852 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
1863 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
1894 return state->resvalue;
1915 return state->evalfunc(
state, econtext, isNull);
1933 for (
int i = 0;
i <
state->steps_len;
i++)
1999 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
2004 if (attr->attisdropped)
2006 (
errcode(ERRCODE_UNDEFINED_COLUMN),
2007 errmsg(
"attribute %d of type %s has been dropped",
2010 if (
vartype != attr->atttypid)
2012 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2013 errmsg(
"attribute %d of type %s has wrong type",
2015 errdetail(
"Table has type %s, but query expects %s.",
2027 #ifdef USE_ASSERT_CHECKING
2029 if (!
op->d.fetch.fixed)
2076 if (type_id != RECORDOID)
2092 if (typentry->
tupDesc == NULL)
2094 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
2095 errmsg(
"type %s is not composite",
2179 int attnum =
op->d.assign_var.attnum + 1;
2194 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2235 *
op->resvalue = *
op->d.casetest.value;
2236 *
op->resnull = *
op->d.casetest.isnull;
2241 fcinfo =
op->d.func.fcinfo_data;
2245 for (
int argno = 0; argno <
nargs; argno++)
2254 d =
op->d.func.fn_addr(fcinfo);
2266 return op->d.constval.value;
2317 int attnum =
op->d.assign_var.attnum;
2326 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2355 #if defined(EEO_USE_COMPUTED_GOTO)
2361 dispatch_compare_ptr(
const void *
a,
const void *
b)
2363 const ExprEvalOpLookup *la = (
const ExprEvalOpLookup *)
a;
2364 const ExprEvalOpLookup *lb = (
const ExprEvalOpLookup *)
b;
2366 if (la->opcode < lb->opcode)
2368 else if (la->opcode > lb->opcode)
2380 #if defined(EEO_USE_COMPUTED_GOTO)
2382 if (dispatch_table == NULL)
2384 dispatch_table = (
const void **)
2390 reverse_dispatch_table[
i].opcode = dispatch_table[
i];
2395 qsort(reverse_dispatch_table,
2397 sizeof(ExprEvalOpLookup),
2398 dispatch_compare_ptr);
2412 #if defined(EEO_USE_COMPUTED_GOTO)
2415 ExprEvalOpLookup
key;
2416 ExprEvalOpLookup *
res;
2418 key.opcode = (
void *)
op->opcode;
2420 reverse_dispatch_table,
2422 sizeof(ExprEvalOpLookup),
2423 dispatch_compare_ptr);
2450 d =
op->d.func.fn_addr(fcinfo);
2472 for (
int argno = 0; argno <
nargs; argno++)
2476 *
op->resnull =
true;
2484 d =
op->d.func.fn_addr(fcinfo);
2523 int paramId =
op->d.param.paramid;
2526 paramId > 0 && paramId <= paramInfo->numParams))
2533 prm = paramInfo->
paramFetch(paramInfo, paramId,
false, &prmdata);
2535 prm = ¶mInfo->
params[paramId - 1];
2542 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2543 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
2554 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2555 errmsg(
"no value found for parameter %d", paramId)));
2581 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
2585 fcinfo_out->
isnull =
false;
2593 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
2597 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
2605 fcinfo_in->
isnull =
false;
2610 *
op->resnull =
true;
2632 *
op->resnull =
false;
2664 *
op->resnull = fcinfo->isnull;
2669 *
op->resnull = fcinfo->isnull;
2674 *
op->resnull = fcinfo->isnull;
2679 *
op->resnull = fcinfo->isnull;
2697 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2698 errmsg(
"WHERE CURRENT OF is not supported for this table type")));
2709 switch (
op->d.nextvalueexpr.seqtypid)
2721 elog(
ERROR,
"unsupported sequence type %u",
2722 op->d.nextvalueexpr.seqtypid);
2724 *
op->resnull =
false;
2758 *
op->resnull =
false;
2790 &
op->d.nulltest_row.rowcache, NULL);
2798 for (
int att = 1; att <= tupDesc->
natts; att++)
2837 int nelems =
op->d.arrayexpr.nelems;
2843 *
op->resnull =
false;
2845 if (!
op->d.arrayexpr.multidims)
2848 Datum *dvalues =
op->d.arrayexpr.elemvalues;
2849 bool *dnulls =
op->d.arrayexpr.elemnulls;
2858 op->d.arrayexpr.elemlength,
2859 op->d.arrayexpr.elembyval,
2860 op->d.arrayexpr.elemalign);
2867 int outer_nelems = 0;
2869 int *elem_dims = NULL;
2870 int *elem_lbs = NULL;
2871 bool firstone =
true;
2872 bool havenulls =
false;
2873 bool haveempty =
false;
2888 for (
int elemoff = 0; elemoff <
nelems; elemoff++)
2895 arraydatum =
op->d.arrayexpr.elemvalues[elemoff];
2896 eisnull =
op->d.arrayexpr.elemnulls[elemoff];
2910 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2911 errmsg(
"cannot merge incompatible arrays"),
2912 errdetail(
"Array with element type %s cannot be "
2913 "included in ARRAY construct with element type %s.",
2919 if (this_ndims <= 0)
2928 elem_ndims = this_ndims;
2929 ndims = elem_ndims + 1;
2930 if (ndims <= 0 || ndims >
MAXDIM)
2932 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
2933 errmsg(
"number of array dimensions (%d) exceeds the maximum allowed (%d)",
2936 elem_dims = (
int *)
palloc(elem_ndims *
sizeof(
int));
2937 memcpy(elem_dims,
ARR_DIMS(array), elem_ndims *
sizeof(
int));
2938 elem_lbs = (
int *)
palloc(elem_ndims *
sizeof(
int));
2939 memcpy(elem_lbs,
ARR_LBOUND(array), elem_ndims *
sizeof(
int));
2946 if (elem_ndims != this_ndims ||
2948 elem_ndims *
sizeof(
int)) != 0 ||
2950 elem_ndims *
sizeof(
int)) != 0)
2952 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
2953 errmsg(
"multidimensional arrays must have array "
2954 "expressions with matching dimensions")));
2960 nbytes += subbytes[outer_nelems];
2964 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
2965 errmsg(
"array size exceeds the maximum allowed (%d)",
2987 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
2988 errmsg(
"multidimensional arrays must have array "
2989 "expressions with matching dimensions")));
2993 dims[0] = outer_nelems;
2995 for (
int i = 1;
i < ndims;
i++)
2997 dims[
i] = elem_dims[
i - 1];
2998 lbs[
i] = elem_lbs[
i - 1];
3008 nbytes += dataoffset;
3018 result->
ndim = ndims;
3021 memcpy(
ARR_DIMS(result), dims, ndims *
sizeof(
int));
3022 memcpy(
ARR_LBOUND(result), lbs, ndims *
sizeof(
int));
3026 for (
int i = 0;
i < outer_nelems;
i++)
3028 memcpy(dat, subdata[
i], subbytes[
i]);
3034 iitem += subnitems[
i];
3055 arraydatum = *
op->resvalue;
3061 if (
op->d.arraycoerce.elemexprstate == NULL)
3075 op->d.arraycoerce.elemexprstate,
3077 op->d.arraycoerce.resultelemtype,
3078 op->d.arraycoerce.amstate);
3094 op->d.row.elemvalues,
3095 op->d.row.elemnulls);
3098 *
op->resnull =
false;
3111 bool *
nulls =
op->d.minmax.nulls;
3120 *
op->resnull =
true;
3122 for (
int off = 0; off <
op->d.minmax.nelems; off++)
3132 *
op->resnull =
false;
3147 if (cmpresult > 0 &&
operator ==
IS_LEAST)
3149 else if (cmpresult < 0 &&
operator ==
IS_GREATEST)
3176 tupDatum = *
op->resvalue;
3194 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3197 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3202 if (attr->attisdropped)
3204 *
op->resnull =
true;
3210 if (
op->d.fieldselect.resulttype != attr->atttypid)
3212 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3214 errdetail(
"Table has type %s, but query expects %s.",
3232 &
op->d.fieldselect.rowcache, NULL);
3240 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3243 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3248 if (attr->attisdropped)
3250 *
op->resnull =
true;
3256 if (
op->d.fieldselect.resulttype != attr->atttypid)
3258 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3260 errdetail(
"Table has type %s, but query expects %s.",
3291 memset(
op->d.fieldstore.nulls,
true,
3292 op->d.fieldstore.ncolumns *
sizeof(
bool));
3300 Datum tupDatum = *
op->resvalue;
3318 op->d.fieldstore.rowcache, NULL);
3322 elog(
ERROR,
"too many columns in composite type %u",
3323 op->d.fieldstore.fstore->resulttype);
3326 op->d.fieldstore.values,
3327 op->d.fieldstore.nulls);
3343 op->d.fieldstore.rowcache, NULL);
3346 op->d.fieldstore.values,
3347 op->d.fieldstore.nulls);
3350 *
op->resnull =
false;
3368 bool changed =
false;
3374 tupDatum = *
op->resvalue;
3383 op->d.convert_rowtype.incache,
3387 op->d.convert_rowtype.outcache,
3418 if (
op->d.convert_rowtype.map != NULL)
3458 bool useOr =
op->d.scalararrayop.useOr;
3459 bool strictfunc =
op->d.scalararrayop.finfo->fn_strict;
3491 *
op->resnull =
false;
3501 *
op->resnull =
true;
3512 &
op->d.scalararrayop.typlen,
3513 &
op->d.scalararrayop.typbyval,
3514 &
op->d.scalararrayop.typalign);
3518 typlen =
op->d.scalararrayop.typlen;
3537 if (bitmap && (*bitmap & bitmask) == 0)
3555 thisresult = (
Datum) 0;
3560 thisresult =
op->d.scalararrayop.fn_addr(fcinfo);
3589 if (bitmask == 0x100)
3597 *
op->resvalue = result;
3598 *
op->resnull = resultnull;
3614 fcinfo->args[0].value =
key;
3615 fcinfo->args[0].isnull =
false;
3634 fcinfo->args[0].value = key1;
3635 fcinfo->args[0].isnull =
false;
3636 fcinfo->args[1].value = key2;
3637 fcinfo->args[1].isnull =
false;
3662 bool inclause =
op->d.hashedscalararrayop.inclause;
3663 bool strictfunc =
op->d.hashedscalararrayop.finfo->fn_strict;
3679 *
op->resnull =
true;
3698 saop =
op->d.hashedscalararrayop.saop;
3743 if (bitmap && (*bitmap & bitmask) == 0)
3762 if (bitmask == 0x100)
3794 if (!hashfound &&
op->d.hashedscalararrayop.has_nulls)
3820 result =
op->d.hashedscalararrayop.finfo->fn_addr(fcinfo);
3821 resultnull = fcinfo->
isnull;
3832 *
op->resvalue = result;
3833 *
op->resnull = resultnull;
3844 (
errcode(ERRCODE_NOT_NULL_VIOLATION),
3845 errmsg(
"domain %s does not allow null values",
3856 if (!*
op->d.domaincheck.checknull &&
3859 (
errcode(ERRCODE_CHECK_VIOLATION),
3860 errmsg(
"value for domain %s violates check constraint \"%s\"",
3862 op->d.domaincheck.constraintname),
3864 op->d.domaincheck.constraintname)));
3879 *
op->resnull =
true;
3899 *
op->resnull =
false;
3907 bool *
argnull =
op->d.xmlexpr.named_argnull;
3929 *
op->resnull =
false;
3948 op->d.xmlexpr.named_argvalue,
3949 op->d.xmlexpr.named_argnull,
3950 op->d.xmlexpr.argvalue,
3951 op->d.xmlexpr.argnull));
3952 *
op->resnull =
false;
3960 bool preserve_whitespace;
3977 preserve_whitespace));
3978 *
op->resnull =
false;
4037 *
op->resnull =
false;
4057 *
op->resnull =
false;
4075 *
op->resnull =
false;
4080 elog(
ERROR,
"unrecognized XML operation");
4157 elog(
ERROR,
"invalid JsonConstructorExpr type %d", ctor->
type);
4159 *
op->resvalue =
res;
4182 if (exprtype == TEXTOID || exprtype == JSONOID)
4218 else if (exprtype == JSONBOID)
4301 !throw_error ? &
error : NULL,
4307 *
op->resnull =
false;
4314 !throw_error ? &
error : NULL,
4330 if (jump_eval_coercion >= 0)
4340 !throw_error ? &
error : NULL,
4348 *
op->resnull =
true;
4350 else if (!
error && !empty)
4368 if (jump_eval_coercion >= 0)
4378 elog(
ERROR,
"unrecognized SQL/JSON expression op %d",
4391 Assert(jump_eval_coercion == -1);
4413 *
op->resnull =
true;
4432 errcode(ERRCODE_NO_SQL_JSON_ITEM),
4433 errmsg(
"no SQL/JSON item found for specified path of column \"%s\"",
4437 errcode(ERRCODE_NO_SQL_JSON_ITEM),
4438 errmsg(
"no SQL/JSON item found for specified path"));
4449 *
op->resnull =
true;
4478 memcpy(
str, item->
val.string.val, item->
val.string.len);
4479 str[item->
val.string.len] =
'\0';
4492 switch (item->
val.datetime.typid)
4496 item->
val.datetime.value));
4499 item->
val.datetime.value));
4502 item->
val.datetime.value));
4505 item->
val.datetime.value));
4506 case TIMESTAMPTZOID:
4508 item->
val.datetime.value));
4510 elog(
ERROR,
"unexpected jsonb datetime type oid %u",
4511 item->
val.datetime.typid);
4544 op->d.jsonexpr_coercion.targettype,
4545 op->d.jsonexpr_coercion.targettypmod,
4546 &
op->d.jsonexpr_coercion.json_populate_type_cache,
4564 *
op->resnull =
true;
4586 foreach(lc,
op->d.grouping_func.clauses)
4597 *
op->resnull =
false;
4613 elog(
ERROR,
"no merge action in progress");
4620 *
op->resnull =
false;
4624 *
op->resnull =
false;
4628 *
op->resnull =
false;
4631 elog(
ERROR,
"unexpected merge action: DO NOTHING");
4634 elog(
ERROR,
"unrecognized commandType: %d",
4694 if (
op->d.wholerow.junkFilter != NULL)
4704 if (
op->d.wholerow.first)
4707 op->d.wholerow.slow =
false;
4713 if (
variable->vartype != RECORDOID)
4738 if (var_tupdesc->
natts != slot_tupdesc->
natts)
4740 (
errcode(ERRCODE_DATATYPE_MISMATCH),
4741 errmsg(
"table row type and query-specified row type do not match"),
4743 "Table row contains %d attributes, but query expects %d.",
4744 slot_tupdesc->
natts,
4745 slot_tupdesc->
natts,
4746 var_tupdesc->
natts)));
4748 for (
int i = 0;
i < var_tupdesc->
natts;
i++)
4753 if (vattr->atttypid == sattr->atttypid)
4755 if (!vattr->attisdropped)
4757 (
errcode(ERRCODE_DATATYPE_MISMATCH),
4758 errmsg(
"table row type and query-specified row type do not match"),
4759 errdetail(
"Table has type %s at ordinal position %d, but query expects %s.",
4764 if (vattr->attlen != sattr->attlen ||
4765 vattr->attalign != sattr->attalign)
4766 op->d.wholerow.slow =
true;
4796 output_tupdesc->
tdtypeid = RECORDOID;
4827 op->d.wholerow.first =
false;
4836 if (
op->d.wholerow.slow)
4844 for (
int i = 0;
i < var_tupdesc->
natts;
i++)
4849 if (!vattr->attisdropped)
4853 if (vattr->attlen != sattr->attlen ||
4854 vattr->attalign != sattr->attalign)
4856 (
errcode(ERRCODE_DATATYPE_MISMATCH),
4857 errmsg(
"table row type and query-specified row type do not match"),
4858 errdetail(
"Physical storage mismatch on dropped attribute at ordinal position %d.",
4883 *
op->resnull =
false;
4899 elog(
ERROR,
"failed to fetch attribute from slot");
4961 Datum newValue,
bool newValueIsNull,
4962 Datum oldValue,
bool oldValueIsNull)
4964 Assert(newValue != oldValue);
4966 if (!newValueIsNull)
4986 newValue = (
Datum) 0;
4989 if (!oldValueIsNull)
5055 bool isdistinct =
false;
5103 int setno =
op->d.agg_trans.setno;
5106 *
op->resvalue, *
op->resnull);
5117 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)
Datum array_map(Datum arrayd, ExprState *exprstate, ExprContext *econtext, Oid retType, ArrayMapState *amstate)
ArrayType * construct_empty_array(Oid elmtype)
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 Assert(condition)
#define pg_attribute_always_inline
#define StaticAssertDecl(condition, errmessage)
#define OidIsValid(objectId)
int64 nextval_internal(Oid relid, bool check_permissions)
TimeTzADT * GetSQLCurrentTime(int32 typmod)
TimeADT GetSQLLocalTime(int32 typmod)
Datum date_out(PG_FUNCTION_ARGS)
Datum time_out(PG_FUNCTION_ARGS)
DateADT GetSQLCurrentDate(void)
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)
static void PGresult * res
int errdatatype(Oid datatypeOid)
int errdomainconstraint(Oid datatypeOid, const char *conname)
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)
static Datum ExecJustAssignInnerVarVirt(ExprState *state, ExprContext *econtext, bool *isnull)
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)
void ExecEvalConvertRowtype(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
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)
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)
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)
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)
ExprEvalOp ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
static Datum ExecJustAssignOuterVar(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)
#define EEO_FLAG_INTERPRETER_INITIALIZED
#define EEO_FLAG_DIRECT_THREADED
@ EEOP_FUNCEXPR_STRICT_FUSAGE
@ EEOP_JSONEXPR_COERCION_FINISH
@ 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
@ EEOP_NULLTEST_ROWISNULL
@ EEOP_NULLTEST_ISNOTNULL
@ EEOP_MERGE_SUPPORT_FUNC
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
@ EEOP_BOOL_AND_STEP_FIRST
@ EEOP_BOOL_AND_STEP_LAST
@ EEOP_AGG_ORDERED_TRANS_DATUM
@ 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)(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)
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)
#define HeapTupleHeaderSetTypMod(tup, typmod)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
#define HeapTupleHeaderGetTypMod(tup)
#define HeapTupleHeaderGetTypeId(tup)
#define HeapTupleHeaderGetDatumLength(tup)
#define HeapTupleHeaderSetTypeId(tup, typeid)
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_out(PG_FUNCTION_ARGS)
char * JsonbUnquote(Jsonb *jb)
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)
static Jsonb * DatumGetJsonbP(Datum d)
#define JB_ROOT_IS_OBJECT(jbp_)
static Datum JsonbPGetDatum(const Jsonb *p)
#define JB_ROOT_IS_ARRAY(jbp_)
#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, 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)
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)
FormData_pg_attribute * Form_pg_attribute
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)
void check_stack_depth(void)
static uint32 DatumGetUInt32(Datum X)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static char * DatumGetCString(Datum X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Pointer DatumGetPointer(Datum X)
static Datum Int32GetDatum(int32 X)
static int32 DatumGetInt32(Datum X)
@ SVFOP_CURRENT_TIMESTAMP
@ SVFOP_CURRENT_TIMESTAMP_N
MemoryContextSwitchTo(old_ctx)
static chr element(struct vars *v, const chr *startp, const chr *endp)
static unsigned hash(unsigned *uv, int n)
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_scantuple
MemoryContext ecxt_per_query_memory
struct EState * ecxt_estate
TupleTableSlot * ecxt_outertuple
union ExprEvalStep::@54 d
struct ScalarArrayOpExprHashTable * elements_tab
AggStatePerTrans pertrans
struct JsonExprState * jsestate
ErrorSaveContext * escontext
ExprEvalRowtypeCache rowcache
struct JsonConstructorExprState * jcstate
struct ExprEvalStep::@54::@86 hashedscalararrayop
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]
JsonConstructorExpr * constructor
struct JsonConstructorExprState::@101 * 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)
struct TupleDescData * TupleDesc
#define TupleDescAttr(tupdesc, i)
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 TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static void slot_getsomeattrs(TupleTableSlot *slot, int attnum)
static TupleTableSlot * ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static Datum slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static void slot_getallattrs(TupleTableSlot *slot)
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 * xmlconcat(List *args)
text * xmltotext_with_options(xmltype *data, XmlOptionType xmloption_arg, bool indent)
xmltype * xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace)
bool xml_is_document(xmltype *arg)
xmltype * xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null)
char * map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings)
xmltype * xmlelement(XmlExpr *xexpr, Datum *named_argvalue, bool *named_argnull, Datum *argvalue, bool *argnull)
xmltype * xmlroot(xmltype *data, text *version, int standalone)
static xmltype * DatumGetXmlP(Datum X)