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
282 if (
state->steps_len == 5)
298 else if (
state->steps_len == 4)
326 else if (
state->steps_len == 3)
369 state->steps[0].d.casetest.value)
387 else if (
state->steps_len == 2)
428#if defined(EEO_USE_COMPUTED_GOTO)
434 for (
int off = 0; off <
state->steps_len; off++)
471#if defined(EEO_USE_COMPUTED_GOTO)
472 static const void *
const dispatch_table[] = {
474 &&CASE_EEOP_INNER_FETCHSOME,
475 &&CASE_EEOP_OUTER_FETCHSOME,
476 &&CASE_EEOP_SCAN_FETCHSOME,
477 &&CASE_EEOP_OLD_FETCHSOME,
478 &&CASE_EEOP_NEW_FETCHSOME,
479 &&CASE_EEOP_INNER_VAR,
480 &&CASE_EEOP_OUTER_VAR,
481 &&CASE_EEOP_SCAN_VAR,
484 &&CASE_EEOP_INNER_SYSVAR,
485 &&CASE_EEOP_OUTER_SYSVAR,
486 &&CASE_EEOP_SCAN_SYSVAR,
487 &&CASE_EEOP_OLD_SYSVAR,
488 &&CASE_EEOP_NEW_SYSVAR,
489 &&CASE_EEOP_WHOLEROW,
490 &&CASE_EEOP_ASSIGN_INNER_VAR,
491 &&CASE_EEOP_ASSIGN_OUTER_VAR,
492 &&CASE_EEOP_ASSIGN_SCAN_VAR,
493 &&CASE_EEOP_ASSIGN_OLD_VAR,
494 &&CASE_EEOP_ASSIGN_NEW_VAR,
495 &&CASE_EEOP_ASSIGN_TMP,
496 &&CASE_EEOP_ASSIGN_TMP_MAKE_RO,
498 &&CASE_EEOP_FUNCEXPR,
499 &&CASE_EEOP_FUNCEXPR_STRICT,
500 &&CASE_EEOP_FUNCEXPR_FUSAGE,
501 &&CASE_EEOP_FUNCEXPR_STRICT_FUSAGE,
502 &&CASE_EEOP_BOOL_AND_STEP_FIRST,
503 &&CASE_EEOP_BOOL_AND_STEP,
504 &&CASE_EEOP_BOOL_AND_STEP_LAST,
505 &&CASE_EEOP_BOOL_OR_STEP_FIRST,
506 &&CASE_EEOP_BOOL_OR_STEP,
507 &&CASE_EEOP_BOOL_OR_STEP_LAST,
508 &&CASE_EEOP_BOOL_NOT_STEP,
511 &&CASE_EEOP_JUMP_IF_NULL,
512 &&CASE_EEOP_JUMP_IF_NOT_NULL,
513 &&CASE_EEOP_JUMP_IF_NOT_TRUE,
514 &&CASE_EEOP_NULLTEST_ISNULL,
515 &&CASE_EEOP_NULLTEST_ISNOTNULL,
516 &&CASE_EEOP_NULLTEST_ROWISNULL,
517 &&CASE_EEOP_NULLTEST_ROWISNOTNULL,
518 &&CASE_EEOP_BOOLTEST_IS_TRUE,
519 &&CASE_EEOP_BOOLTEST_IS_NOT_TRUE,
520 &&CASE_EEOP_BOOLTEST_IS_FALSE,
521 &&CASE_EEOP_BOOLTEST_IS_NOT_FALSE,
522 &&CASE_EEOP_PARAM_EXEC,
523 &&CASE_EEOP_PARAM_EXTERN,
524 &&CASE_EEOP_PARAM_CALLBACK,
525 &&CASE_EEOP_PARAM_SET,
526 &&CASE_EEOP_CASE_TESTVAL,
527 &&CASE_EEOP_MAKE_READONLY,
528 &&CASE_EEOP_IOCOERCE,
529 &&CASE_EEOP_IOCOERCE_SAFE,
530 &&CASE_EEOP_DISTINCT,
531 &&CASE_EEOP_NOT_DISTINCT,
533 &&CASE_EEOP_SQLVALUEFUNCTION,
534 &&CASE_EEOP_CURRENTOFEXPR,
535 &&CASE_EEOP_NEXTVALUEEXPR,
536 &&CASE_EEOP_RETURNINGEXPR,
537 &&CASE_EEOP_ARRAYEXPR,
538 &&CASE_EEOP_ARRAYCOERCE,
540 &&CASE_EEOP_ROWCOMPARE_STEP,
541 &&CASE_EEOP_ROWCOMPARE_FINAL,
543 &&CASE_EEOP_FIELDSELECT,
544 &&CASE_EEOP_FIELDSTORE_DEFORM,
545 &&CASE_EEOP_FIELDSTORE_FORM,
546 &&CASE_EEOP_SBSREF_SUBSCRIPTS,
547 &&CASE_EEOP_SBSREF_OLD,
548 &&CASE_EEOP_SBSREF_ASSIGN,
549 &&CASE_EEOP_SBSREF_FETCH,
550 &&CASE_EEOP_DOMAIN_TESTVAL,
551 &&CASE_EEOP_DOMAIN_NOTNULL,
552 &&CASE_EEOP_DOMAIN_CHECK,
553 &&CASE_EEOP_HASHDATUM_SET_INITVAL,
554 &&CASE_EEOP_HASHDATUM_FIRST,
555 &&CASE_EEOP_HASHDATUM_FIRST_STRICT,
556 &&CASE_EEOP_HASHDATUM_NEXT32,
557 &&CASE_EEOP_HASHDATUM_NEXT32_STRICT,
558 &&CASE_EEOP_CONVERT_ROWTYPE,
559 &&CASE_EEOP_SCALARARRAYOP,
560 &&CASE_EEOP_HASHED_SCALARARRAYOP,
562 &&CASE_EEOP_JSON_CONSTRUCTOR,
564 &&CASE_EEOP_JSONEXPR_PATH,
565 &&CASE_EEOP_JSONEXPR_COERCION,
566 &&CASE_EEOP_JSONEXPR_COERCION_FINISH,
568 &&CASE_EEOP_GROUPING_FUNC,
569 &&CASE_EEOP_WINDOW_FUNC,
570 &&CASE_EEOP_MERGE_SUPPORT_FUNC,
572 &&CASE_EEOP_AGG_STRICT_DESERIALIZE,
573 &&CASE_EEOP_AGG_DESERIALIZE,
574 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_ARGS,
575 &&CASE_EEOP_AGG_STRICT_INPUT_CHECK_NULLS,
576 &&CASE_EEOP_AGG_PLAIN_PERGROUP_NULLCHECK,
577 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL,
578 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL,
579 &&CASE_EEOP_AGG_PLAIN_TRANS_BYVAL,
580 &&CASE_EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF,
581 &&CASE_EEOP_AGG_PLAIN_TRANS_STRICT_BYREF,
582 &&CASE_EEOP_AGG_PLAIN_TRANS_BYREF,
583 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_SINGLE,
584 &&CASE_EEOP_AGG_PRESORTED_DISTINCT_MULTI,
585 &&CASE_EEOP_AGG_ORDERED_TRANS_DATUM,
586 &&CASE_EEOP_AGG_ORDERED_TRANS_TUPLE,
591 "dispatch_table out of whack with ExprEvalOp");
601 resultslot =
state->resultslot;
608#if defined(EEO_USE_COMPUTED_GOTO)
774 int attnum =
op->d.assign_var.attnum;
781 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
791 int attnum =
op->d.assign_var.attnum;
798 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
808 int attnum =
op->d.assign_var.attnum;
815 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
825 int attnum =
op->d.assign_var.attnum;
832 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
842 int attnum =
op->d.assign_var.attnum;
849 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
860 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
871 Assert(
resultnum >= 0 && resultnum < resultslot->tts_tupleDescriptor->natts);
884 *
op->resnull =
op->d.constval.isnull;
885 *
op->resvalue =
op->d.constval.value;
911 d =
op->d.func.fn_addr(fcinfo);
926 for (
int argno = 0; argno <
nargs; argno++)
935 d =
op->d.func.fn_addr(fcinfo);
971 *
op->d.boolexpr.anynull =
false;
985 *
op->d.boolexpr.anynull =
true;
1013 else if (*
op->d.boolexpr.anynull)
1016 *
op->resnull =
true;
1038 *
op->d.boolexpr.anynull =
false;
1052 *
op->d.boolexpr.anynull =
true;
1080 else if (*
op->d.boolexpr.anynull)
1083 *
op->resnull =
true;
1115 *
op->resnull =
false;
1164 *
op->resnull =
false;
1172 *
op->resnull =
false;
1200 *
op->resnull =
false;
1212 *
op->resnull =
false;
1225 *
op->resnull =
false;
1238 *
op->resnull =
false;
1263 op->d.cparam.paramfunc(
state,
op, econtext);
1285 if (
op->d.casetest.value)
1287 *
op->resvalue = *
op->d.casetest.value;
1288 *
op->resnull = *
op->d.casetest.isnull;
1304 if (
op->d.casetest.value)
1306 *
op->resvalue = *
op->d.casetest.value;
1307 *
op->resnull = *
op->d.casetest.isnull;
1323 if (!*
op->d.make_readonly.isnull)
1326 *
op->resnull = *
op->d.make_readonly.isnull;
1353 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
1357 fcinfo_out->
isnull =
false;
1365 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
1370 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
1375 fcinfo_in->
isnull =
false;
1419 *
op->resnull =
false;
1425 *
op->resnull =
false;
1433 eqresult =
op->d.func.fn_addr(fcinfo);
1450 *
op->resnull =
false;
1455 *
op->resnull =
false;
1462 eqresult =
op->d.func.fn_addr(fcinfo);
1463 *
op->resvalue = eqresult;
1490 if (
op->d.func.make_ro)
1495 result =
op->d.func.fn_addr(fcinfo);
1501 *
op->resnull =
true;
1508 *
op->resvalue = save_arg0;
1550 if (
state->flags &
op->d.returningexpr.nullflag)
1553 *
op->resnull =
true;
1591 if (
op->d.rowcompare_step.finfo->fn_strict &&
1594 *
op->resnull =
true;
1600 d =
op->d.rowcompare_step.fn_addr(fcinfo);
1606 *
op->resnull =
true;
1609 *
op->resnull =
false;
1625 *
op->resnull =
false;
1684 if (
op->d.sbsref_subscript.subscriptfunc(
state,
op, econtext))
1700 op->d.sbsref.subscriptfunc(
state,
op, econtext);
1747 *
op->resvalue =
op->d.hashdatum_initvalue.init_value;
1748 *
op->resnull =
false;
1762 *
op->resvalue =
op->d.hashdatum.fn_addr(fcinfo);
1766 *
op->resnull =
false;
1782 *
op->resnull =
true;
1788 *
op->resvalue =
op->d.hashdatum.fn_addr(fcinfo);
1789 *
op->resnull =
false;
1810 existinghash = existinghash ^ hashvalue;
1814 *
op->resnull =
false;
1830 *
op->resnull =
true;
1846 *
op->resnull =
false;
1903 int aggno =
op->d.aggref.aggno;
1956 if (
op->d.agg_deserialize.fcinfo_data->args[0].isnull)
1990 int nargs =
op->d.agg_strict_input_check.nargs;
1992 for (
int argno = 0; argno <
nargs; argno++)
1995 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2002 bool *
nulls =
op->d.agg_strict_input_check.nulls;
2003 int nargs =
op->d.agg_strict_input_check.nargs;
2005 for (
int argno = 0; argno <
nargs; argno++)
2008 EEO_JUMP(
op->d.agg_strict_input_check.jumpnull);
2023 if (pergroup_allaggs == NULL)
2024 EEO_JUMP(
op->d.agg_plain_pergroup_nullcheck.jumpnull);
2054 op->d.agg_trans.aggcontext);
2061 op->d.agg_trans.aggcontext,
2062 op->d.agg_trans.setno);
2080 op->d.agg_trans.aggcontext,
2081 op->d.agg_trans.setno);
2097 op->d.agg_trans.aggcontext,
2098 op->d.agg_trans.setno);
2115 op->d.agg_trans.aggcontext);
2118 op->d.agg_trans.aggcontext,
2119 op->d.agg_trans.setno);
2136 op->d.agg_trans.aggcontext,
2137 op->d.agg_trans.setno);
2152 op->d.agg_trans.aggcontext,
2153 op->d.agg_trans.setno);
2166 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
2177 EEO_JUMP(
op->d.agg_presorted_distinctcheck.jumpdistinct);
2208 return state->resvalue;
2229 return state->evalfunc(
state, econtext, isNull);
2251 for (
int i = 0;
i <
state->steps_len;
i++)
2333 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
2338 if (attr->attisdropped)
2340 (
errcode(ERRCODE_UNDEFINED_COLUMN),
2341 errmsg(
"attribute %d of type %s has been dropped",
2344 if (
vartype != attr->atttypid)
2346 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2347 errmsg(
"attribute %d of type %s has wrong type",
2349 errdetail(
"Table has type %s, but query expects %s.",
2361#ifdef USE_ASSERT_CHECKING
2363 if (!
op->d.fetch.fixed)
2410 if (type_id != RECORDOID)
2426 if (typentry->
tupDesc == NULL)
2428 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
2429 errmsg(
"type %s is not composite",
2513 int attnum =
op->d.assign_var.attnum + 1;
2528 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2569 *
op->resvalue = *
op->d.casetest.value;
2570 *
op->resnull = *
op->d.casetest.isnull;
2575 fcinfo =
op->d.func.fcinfo_data;
2579 for (
int argno = 0; argno <
nargs; argno++)
2588 d =
op->d.func.fn_addr(fcinfo);
2600 return op->d.constval.value;
2651 int attnum =
op->d.assign_var.attnum;
2660 Assert(
resultnum >= 0 && resultnum < outslot->tts_tupleDescriptor->natts);
2718 hashkey = hashkey ^ hashvalue;
2831#if defined(EEO_USE_COMPUTED_GOTO)
2837dispatch_compare_ptr(
const void *
a,
const void *
b)
2839 const ExprEvalOpLookup *la = (
const ExprEvalOpLookup *)
a;
2840 const ExprEvalOpLookup *lb = (
const ExprEvalOpLookup *)
b;
2842 if (la->opcode < lb->opcode)
2844 else if (la->opcode > lb->opcode)
2856#if defined(EEO_USE_COMPUTED_GOTO)
2858 if (dispatch_table == NULL)
2860 dispatch_table = (
const void **)
2866 reverse_dispatch_table[
i].opcode = dispatch_table[
i];
2871 qsort(reverse_dispatch_table,
2873 sizeof(ExprEvalOpLookup),
2874 dispatch_compare_ptr);
2888#if defined(EEO_USE_COMPUTED_GOTO)
2891 ExprEvalOpLookup
key;
2892 ExprEvalOpLookup *
res;
2894 key.opcode = (
void *)
op->opcode;
2896 reverse_dispatch_table,
2898 sizeof(ExprEvalOpLookup),
2899 dispatch_compare_ptr);
2926 d =
op->d.func.fn_addr(fcinfo);
2948 for (
int argno = 0; argno <
nargs; argno++)
2952 *
op->resnull =
true;
2960 d =
op->d.func.fn_addr(fcinfo);
2999 int paramId =
op->d.param.paramid;
3002 paramId > 0 && paramId <= paramInfo->numParams))
3009 prm = paramInfo->
paramFetch(paramInfo, paramId,
false, &prmdata);
3011 prm = ¶mInfo->
params[paramId - 1];
3018 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3019 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
3030 (
errcode(ERRCODE_UNDEFINED_OBJECT),
3031 errmsg(
"no value found for parameter %d", paramId)));
3075 fcinfo_out =
op->d.iocoerce.fcinfo_data_out;
3079 fcinfo_out->
isnull =
false;
3087 if (!
op->d.iocoerce.finfo_in->fn_strict ||
str != NULL)
3091 fcinfo_in =
op->d.iocoerce.fcinfo_data_in;
3099 fcinfo_in->
isnull =
false;
3104 *
op->resnull =
true;
3126 *
op->resnull =
false;
3158 *
op->resnull = fcinfo->isnull;
3163 *
op->resnull = fcinfo->isnull;
3168 *
op->resnull = fcinfo->isnull;
3173 *
op->resnull = fcinfo->isnull;
3191 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3192 errmsg(
"WHERE CURRENT OF is not supported for this table type")));
3203 switch (
op->d.nextvalueexpr.seqtypid)
3215 elog(
ERROR,
"unsupported sequence type %u",
3216 op->d.nextvalueexpr.seqtypid);
3218 *
op->resnull =
false;
3252 *
op->resnull =
false;
3284 &
op->d.nulltest_row.rowcache, NULL);
3292 for (
int att = 1; att <= tupDesc->
natts; att++)
3331 int nelems =
op->d.arrayexpr.nelems;
3337 *
op->resnull =
false;
3339 if (!
op->d.arrayexpr.multidims)
3342 Datum *dvalues =
op->d.arrayexpr.elemvalues;
3343 bool *dnulls =
op->d.arrayexpr.elemnulls;
3352 op->d.arrayexpr.elemlength,
3353 op->d.arrayexpr.elembyval,
3354 op->d.arrayexpr.elemalign);
3361 int outer_nelems = 0;
3363 int *elem_dims = NULL;
3364 int *elem_lbs = NULL;
3365 bool firstone =
true;
3366 bool havenulls =
false;
3367 bool haveempty =
false;
3382 for (
int elemoff = 0; elemoff <
nelems; elemoff++)
3389 arraydatum =
op->d.arrayexpr.elemvalues[elemoff];
3390 eisnull =
op->d.arrayexpr.elemnulls[elemoff];
3404 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3405 errmsg(
"cannot merge incompatible arrays"),
3406 errdetail(
"Array with element type %s cannot be "
3407 "included in ARRAY construct with element type %s.",
3413 if (this_ndims <= 0)
3422 elem_ndims = this_ndims;
3423 ndims = elem_ndims + 1;
3424 if (ndims <= 0 || ndims >
MAXDIM)
3426 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3427 errmsg(
"number of array dimensions (%d) exceeds the maximum allowed (%d)",
3430 elem_dims = (
int *)
palloc(elem_ndims *
sizeof(
int));
3431 memcpy(elem_dims,
ARR_DIMS(array), elem_ndims *
sizeof(
int));
3432 elem_lbs = (
int *)
palloc(elem_ndims *
sizeof(
int));
3433 memcpy(elem_lbs,
ARR_LBOUND(array), elem_ndims *
sizeof(
int));
3440 if (elem_ndims != this_ndims ||
3442 elem_ndims *
sizeof(
int)) != 0 ||
3444 elem_ndims *
sizeof(
int)) != 0)
3446 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
3447 errmsg(
"multidimensional arrays must have array "
3448 "expressions with matching dimensions")));
3454 nbytes += subbytes[outer_nelems];
3458 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3459 errmsg(
"array size exceeds the maximum allowed (%d)",
3481 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
3482 errmsg(
"multidimensional arrays must have array "
3483 "expressions with matching dimensions")));
3487 dims[0] = outer_nelems;
3489 for (
int i = 1;
i < ndims;
i++)
3491 dims[
i] = elem_dims[
i - 1];
3492 lbs[
i] = elem_lbs[
i - 1];
3502 nbytes += dataoffset;
3512 result->
ndim = ndims;
3515 memcpy(
ARR_DIMS(result), dims, ndims *
sizeof(
int));
3516 memcpy(
ARR_LBOUND(result), lbs, ndims *
sizeof(
int));
3520 for (
int i = 0;
i < outer_nelems;
i++)
3522 memcpy(dat, subdata[
i], subbytes[
i]);
3528 iitem += subnitems[
i];
3549 arraydatum = *
op->resvalue;
3555 if (
op->d.arraycoerce.elemexprstate == NULL)
3569 op->d.arraycoerce.elemexprstate,
3571 op->d.arraycoerce.resultelemtype,
3572 op->d.arraycoerce.amstate);
3588 op->d.row.elemvalues,
3589 op->d.row.elemnulls);
3592 *
op->resnull =
false;
3605 bool *
nulls =
op->d.minmax.nulls;
3614 *
op->resnull =
true;
3616 for (
int off = 0; off <
op->d.minmax.nelems; off++)
3626 *
op->resnull =
false;
3641 if (cmpresult > 0 &&
operator ==
IS_LEAST)
3643 else if (cmpresult < 0 &&
operator ==
IS_GREATEST)
3670 tupDatum = *
op->resvalue;
3688 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3691 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3696 if (attr->attisdropped)
3698 *
op->resnull =
true;
3704 if (
op->d.fieldselect.resulttype != attr->atttypid)
3706 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3708 errdetail(
"Table has type %s, but query expects %s.",
3726 &
op->d.fieldselect.rowcache, NULL);
3734 elog(
ERROR,
"unsupported reference to system column %d in FieldSelect",
3737 elog(
ERROR,
"attribute number %d exceeds number of columns %d",
3742 if (attr->attisdropped)
3744 *
op->resnull =
true;
3750 if (
op->d.fieldselect.resulttype != attr->atttypid)
3752 (
errcode(ERRCODE_DATATYPE_MISMATCH),
3754 errdetail(
"Table has type %s, but query expects %s.",
3785 memset(
op->d.fieldstore.nulls,
true,
3786 op->d.fieldstore.ncolumns *
sizeof(
bool));
3794 Datum tupDatum = *
op->resvalue;
3812 op->d.fieldstore.rowcache, NULL);
3816 elog(
ERROR,
"too many columns in composite type %u",
3817 op->d.fieldstore.fstore->resulttype);
3820 op->d.fieldstore.values,
3821 op->d.fieldstore.nulls);
3837 op->d.fieldstore.rowcache, NULL);
3840 op->d.fieldstore.values,
3841 op->d.fieldstore.nulls);
3844 *
op->resnull =
false;
3862 bool changed =
false;
3868 tupDatum = *
op->resvalue;
3877 op->d.convert_rowtype.incache,
3881 op->d.convert_rowtype.outcache,
3912 if (
op->d.convert_rowtype.map != NULL)
3952 bool useOr =
op->d.scalararrayop.useOr;
3953 bool strictfunc =
op->d.scalararrayop.finfo->fn_strict;
3985 *
op->resnull =
false;
3995 *
op->resnull =
true;
4006 &
op->d.scalararrayop.typlen,
4007 &
op->d.scalararrayop.typbyval,
4008 &
op->d.scalararrayop.typalign);
4012 typlen =
op->d.scalararrayop.typlen;
4031 if (bitmap && (*bitmap & bitmask) == 0)
4049 thisresult = (
Datum) 0;
4054 thisresult =
op->d.scalararrayop.fn_addr(fcinfo);
4083 if (bitmask == 0x100)
4091 *
op->resvalue = result;
4092 *
op->resnull = resultnull;
4108 fcinfo->args[0].value =
key;
4109 fcinfo->args[0].isnull =
false;
4129 fcinfo->args[0].isnull =
false;
4130 fcinfo->args[1].value = key2;
4131 fcinfo->args[1].isnull =
false;
4156 bool inclause =
op->d.hashedscalararrayop.inclause;
4157 bool strictfunc =
op->d.hashedscalararrayop.finfo->fn_strict;
4173 *
op->resnull =
true;
4192 saop =
op->d.hashedscalararrayop.saop;
4237 if (bitmap && (*bitmap & bitmask) == 0)
4256 if (bitmask == 0x100)
4288 if (!hashfound &&
op->d.hashedscalararrayop.has_nulls)
4314 result =
op->d.hashedscalararrayop.finfo->fn_addr(fcinfo);
4315 resultnull = fcinfo->
isnull;
4326 *
op->resvalue = result;
4327 *
op->resnull = resultnull;
4338 (
errcode(ERRCODE_NOT_NULL_VIOLATION),
4339 errmsg(
"domain %s does not allow null values",
4350 if (!*
op->d.domaincheck.checknull &&
4353 (
errcode(ERRCODE_CHECK_VIOLATION),
4354 errmsg(
"value for domain %s violates check constraint \"%s\"",
4356 op->d.domaincheck.constraintname),
4358 op->d.domaincheck.constraintname)));
4373 *
op->resnull =
true;
4393 *
op->resnull =
false;
4401 bool *
argnull =
op->d.xmlexpr.named_argnull;
4423 *
op->resnull =
false;
4442 op->d.xmlexpr.named_argvalue,
4443 op->d.xmlexpr.named_argnull,
4444 op->d.xmlexpr.argvalue,
4445 op->d.xmlexpr.argnull));
4446 *
op->resnull =
false;
4454 bool preserve_whitespace;
4471 preserve_whitespace));
4472 *
op->resnull =
false;
4531 *
op->resnull =
false;
4551 *
op->resnull =
false;
4569 *
op->resnull =
false;
4574 elog(
ERROR,
"unrecognized XML operation");
4651 elog(
ERROR,
"invalid JsonConstructorExpr type %d", ctor->
type);
4653 *
op->resvalue =
res;
4676 if (exprtype == TEXTOID || exprtype == JSONOID)
4712 else if (exprtype == JSONBOID)
4794 !throw_error ? &
error : NULL,
4799 *
op->resnull =
false;
4807 !throw_error ? &
error : NULL,
4817 !throw_error ? &
error : NULL,
4825 *
op->resnull =
true;
4827 else if (!
error && !empty)
4838 *
op->resnull =
false;
4859 elog(
ERROR,
"unrecognized SQL/JSON expression op %d",
4872 Assert(jump_eval_coercion == -1);
4902 *
op->resnull =
true;
4928 errcode(ERRCODE_NO_SQL_JSON_ITEM),
4929 errmsg(
"no SQL/JSON item found for specified path of column \"%s\"",
4933 errcode(ERRCODE_NO_SQL_JSON_ITEM),
4934 errmsg(
"no SQL/JSON item found for specified path"));
4945 *
op->resnull =
true;