PostgreSQL Source Code  git master
execExpr.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * execExpr.h
4  * Low level infrastructure related to expression evaluation
5  *
6  *
7  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/executor/execExpr.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef EXEC_EXPR_H
15 #define EXEC_EXPR_H
16 
17 #include "executor/nodeAgg.h"
18 #include "nodes/execnodes.h"
19 #include "nodes/miscnodes.h"
20 
21 /* forward references to avoid circularity */
22 struct ExprEvalStep;
26 
27 /* Bits in ExprState->flags (see also execnodes.h for public flag bits): */
28 /* expression's interpreter has been initialized */
29 #define EEO_FLAG_INTERPRETER_INITIALIZED (1 << 1)
30 /* jump-threading is in use */
31 #define EEO_FLAG_DIRECT_THREADED (1 << 2)
32 
33 /* Typical API for out-of-line evaluation subroutines */
35  struct ExprEvalStep *op,
36  ExprContext *econtext);
37 
38 /* API for out-of-line evaluation subroutines returning bool */
40  struct ExprEvalStep *op,
41  ExprContext *econtext);
42 
43 /* ExprEvalSteps that cache a composite type's tupdesc need one of these */
44 /* (it fits in-line in some step types, otherwise allocate out-of-line) */
45 typedef struct ExprEvalRowtypeCache
46 {
47  /*
48  * cacheptr points to composite type's TypeCacheEntry if tupdesc_id is not
49  * 0; or for an anonymous RECORD type, it points directly at the cached
50  * tupdesc for the type, and tupdesc_id is 0. (We'd use separate fields
51  * if space were not at a premium.) Initial state is cacheptr == NULL.
52  */
53  void *cacheptr;
54  uint64 tupdesc_id; /* last-seen tupdesc identifier, or 0 */
56 
57 /*
58  * Discriminator for ExprEvalSteps.
59  *
60  * Identifies the operation to be executed and which member in the
61  * ExprEvalStep->d union is valid.
62  *
63  * The order of entries needs to be kept in sync with the dispatch_table[]
64  * array in execExprInterp.c:ExecInterpExpr().
65  */
66 typedef enum ExprEvalOp
67 {
68  /* entire expression has been evaluated completely, return */
70 
71  /* apply slot_getsomeattrs on corresponding tuple slot */
75 
76  /* compute non-system Var value */
80 
81  /* compute system Var value */
85 
86  /* compute wholerow Var */
88 
89  /*
90  * Compute non-system Var value, assign it into ExprState's resultslot.
91  * These are not used if a CheckVarSlotCompatibility() check would be
92  * needed.
93  */
97 
98  /* assign ExprState's resvalue/resnull to a column of its resultslot */
100  /* ditto, applying MakeExpandedObjectReadOnly() */
102 
103  /* evaluate Const value */
105 
106  /*
107  * Evaluate function call (including OpExprs etc). For speed, we
108  * distinguish in the opcode whether the function is strict and/or
109  * requires usage stats tracking.
110  */
115 
116  /*
117  * Evaluate boolean AND expression, one step per subexpression. FIRST/LAST
118  * subexpressions are special-cased for performance. Since AND always has
119  * at least two subexpressions, FIRST and LAST never apply to the same
120  * subexpression.
121  */
125 
126  /* similarly for boolean OR expression */
130 
131  /* evaluate boolean NOT expression */
133 
134  /* simplified version of BOOL_AND_STEP for use by ExecQual() */
136 
137  /* unconditional jump to another step */
139 
140  /* conditional jumps based on current result value */
144 
145  /* perform NULL tests for scalar values */
148 
149  /* perform NULL tests for row values */
152 
153  /* evaluate a BooleanTest expression */
158 
159  /* evaluate PARAM_EXEC/EXTERN parameters */
163  /* set PARAM_EXEC value */
165 
166  /* return CaseTestExpr value */
168 
169  /* apply MakeExpandedObjectReadOnly() to target value */
171 
172  /* evaluate assorted special-purpose expression types */
184 
185  /*
186  * Compare two individual elements of each of two compared ROW()
187  * expressions. Skip to ROWCOMPARE_FINAL if elements are not equal.
188  */
190 
191  /* evaluate boolean value based on previous ROWCOMPARE_STEP operations */
193 
194  /* evaluate GREATEST() or LEAST() */
196 
197  /* evaluate FieldSelect expression */
199 
200  /*
201  * Deform tuple before evaluating new values for individual fields in a
202  * FieldStore expression.
203  */
205 
206  /*
207  * Form the new tuple for a FieldStore expression. Individual fields will
208  * have been evaluated into columns of the tuple deformed by the preceding
209  * DEFORM step.
210  */
212 
213  /* Process container subscripts; possibly short-circuit result to NULL */
215 
216  /*
217  * Compute old container element/slice when a SubscriptingRef assignment
218  * expression contains SubscriptingRef/FieldStore subexpressions. Value is
219  * accessed using the CaseTest mechanism.
220  */
222 
223  /* compute new value for SubscriptingRef assignment expression */
225 
226  /* compute element/slice for SubscriptingRef fetch expression */
228 
229  /* evaluate value for CoerceToDomainValue */
231 
232  /* evaluate a domain's NOT NULL constraint */
234 
235  /* evaluate a single domain CHECK constraint */
237 
238  /* evaluation steps for hashing */
244 
245  /* evaluate assorted special-purpose expression types */
260 
261  /* aggregation related nodes */
277 
278  /* non-existent operation, used e.g. to check array lengths */
279  EEOP_LAST
281 
282 
283 typedef struct ExprEvalStep
284 {
285  /*
286  * Instruction to be executed. During instruction preparation this is an
287  * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
288  * pointer for computed goto (that's why it's an intptr_t).
289  */
290  intptr_t opcode;
291 
292  /* where to store the result of this step */
294  bool *resnull;
295 
296  /*
297  * Inline data for the operation. Inline data is faster to access, but
298  * also bloats the size of all instructions. The union should be kept to
299  * no more than 40 bytes on 64-bit systems (so that the entire struct is
300  * no more than 64 bytes, a single cacheline on common systems).
301  */
302  union
303  {
304  /* for EEOP_INNER/OUTER/SCAN_FETCHSOME */
305  struct
306  {
307  /* attribute number up to which to fetch (inclusive) */
308  int last_var;
309  /* will the type of slot be the same for every invocation */
310  bool fixed;
311  /* tuple descriptor, if known */
313  /* type of slot, can only be relied upon if fixed is set */
315  } fetch;
316 
317  /* for EEOP_INNER/OUTER/SCAN_[SYS]VAR[_FIRST] */
318  struct
319  {
320  /* attnum is attr number - 1 for regular VAR ... */
321  /* but it's just the normal (negative) attr number for SYSVAR */
322  int attnum;
323  Oid vartype; /* type OID of variable */
324  } var;
325 
326  /* for EEOP_WHOLEROW */
327  struct
328  {
329  Var *var; /* original Var node in plan tree */
330  bool first; /* first time through, need to initialize? */
331  bool slow; /* need runtime check for nulls? */
332  TupleDesc tupdesc; /* descriptor for resulting tuples */
333  JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
335 
336  /* for EEOP_ASSIGN_*_VAR */
337  struct
338  {
339  /* target index in ExprState->resultslot->tts_values/nulls */
341  /* source attribute number - 1 */
342  int attnum;
344 
345  /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
346  struct
347  {
348  /* target index in ExprState->resultslot->tts_values/nulls */
349  int resultnum;
351 
352  /* for EEOP_CONST */
353  struct
354  {
355  /* constant's value */
357  bool isnull;
359 
360  /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
361  struct
362  {
363  FmgrInfo *finfo; /* function's lookup data */
364  FunctionCallInfo fcinfo_data; /* arguments etc */
365  /* faster to access without additional indirection: */
366  PGFunction fn_addr; /* actual call address */
367  int nargs; /* number of arguments */
368  } func;
369 
370  /* for EEOP_BOOL_*_STEP */
371  struct
372  {
373  bool *anynull; /* track if any input was NULL */
374  int jumpdone; /* jump here if result determined */
376 
377  /* for EEOP_QUAL */
378  struct
379  {
380  int jumpdone; /* jump here on false or null */
382 
383  /* for EEOP_JUMP[_CONDITION] */
384  struct
385  {
386  int jumpdone; /* target instruction's index */
387  } jump;
388 
389  /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
390  struct
391  {
392  /* cached descriptor for composite type - filled at runtime */
395 
396  /* for EEOP_PARAM_EXEC/EXTERN and EEOP_PARAM_SET */
397  struct
398  {
399  int paramid; /* numeric ID for parameter */
400  Oid paramtype; /* OID of parameter's datatype */
401  } param;
402 
403  /* for EEOP_PARAM_CALLBACK */
404  struct
405  {
406  ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */
407  void *paramarg; /* private data for same */
408  int paramid; /* numeric ID for parameter */
409  Oid paramtype; /* OID of parameter's datatype */
411 
412  /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
413  struct
414  {
415  Datum *value; /* value to return */
416  bool *isnull;
418 
419  /* for EEOP_MAKE_READONLY */
420  struct
421  {
422  Datum *value; /* value to coerce to read-only */
423  bool *isnull;
425 
426  /* for EEOP_IOCOERCE */
427  struct
428  {
429  /* lookup and call info for source type's output function */
432  /* lookup and call info for result type's input function */
436 
437  /* for EEOP_SQLVALUEFUNCTION */
438  struct
439  {
442 
443  /* for EEOP_NEXTVALUEEXPR */
444  struct
445  {
449 
450  /* for EEOP_ARRAYEXPR */
451  struct
452  {
453  Datum *elemvalues; /* element values get stored here */
454  bool *elemnulls;
455  int nelems; /* length of the above arrays */
456  Oid elemtype; /* array element type */
457  int16 elemlength; /* typlen of the array element type */
458  bool elembyval; /* is the element type pass-by-value? */
459  char elemalign; /* typalign of the element type */
460  bool multidims; /* is array expression multi-D? */
462 
463  /* for EEOP_ARRAYCOERCE */
464  struct
465  {
466  ExprState *elemexprstate; /* null if no per-element work */
467  Oid resultelemtype; /* element type of result array */
468  struct ArrayMapState *amstate; /* workspace for array_map */
470 
471  /* for EEOP_ROW */
472  struct
473  {
474  TupleDesc tupdesc; /* descriptor for result tuples */
475  /* workspace for the values constituting the row: */
476  Datum *elemvalues;
477  bool *elemnulls;
478  } row;
479 
480  /* for EEOP_ROWCOMPARE_STEP */
481  struct
482  {
483  /* lookup and call data for column comparison function */
484  FmgrInfo *finfo;
487  /* target for comparison resulting in NULL */
488  int jumpnull;
489  /* target for comparison yielding inequality */
490  int jumpdone;
492 
493  /* for EEOP_ROWCOMPARE_FINAL */
494  struct
495  {
498 
499  /* for EEOP_MINMAX */
500  struct
501  {
502  /* workspace for argument values */
504  bool *nulls;
505  int nelems;
506  /* is it GREATEST or LEAST? */
508  /* lookup and call data for comparison function */
509  FmgrInfo *finfo;
512 
513  /* for EEOP_FIELDSELECT */
514  struct
515  {
516  AttrNumber fieldnum; /* field number to extract */
517  Oid resulttype; /* field's type */
518  /* cached descriptor for composite type - filled at runtime */
521 
522  /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
523  struct
524  {
525  /* original expression node */
527 
528  /* cached descriptor for composite type - filled at runtime */
529  /* note that a DEFORM and FORM pair share the same cache */
531 
532  /* workspace for column values */
533  Datum *values;
534  bool *nulls;
535  int ncolumns;
537 
538  /* for EEOP_SBSREF_SUBSCRIPTS */
539  struct
540  {
541  ExecEvalBoolSubroutine subscriptfunc; /* evaluation subroutine */
542  /* too big to have inline */
544  int jumpdone; /* jump here on null */
546 
547  /* for EEOP_SBSREF_OLD / ASSIGN / FETCH */
548  struct
549  {
550  ExecEvalSubroutine subscriptfunc; /* evaluation subroutine */
551  /* too big to have inline */
552  struct SubscriptingRefState *state;
554 
555  /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
556  struct
557  {
558  /* name of constraint */
560  /* where the result of a CHECK constraint will be stored */
562  bool *checknull;
563  /* OID of domain type */
564  Oid resulttype;
567 
568  /* for EEOP_HASH_SET_INITVAL */
569  struct
570  {
572 
574 
575  /* for EEOP_HASHDATUM_(FIRST|NEXT32)[_STRICT] */
576  struct
577  {
578  FmgrInfo *finfo; /* function's lookup data */
579  FunctionCallInfo fcinfo_data; /* arguments etc */
580  /* faster to access without additional indirection: */
581  PGFunction fn_addr; /* actual call address */
582  int jumpdone; /* jump here on null */
584 
585  /* for EEOP_CONVERT_ROWTYPE */
586  struct
587  {
588  Oid inputtype; /* input composite type */
589  Oid outputtype; /* output composite type */
590  /* these three fields are filled at runtime: */
591  ExprEvalRowtypeCache *incache; /* cache for input type */
592  ExprEvalRowtypeCache *outcache; /* cache for output type */
593  TupleConversionMap *map; /* column mapping */
595 
596  /* for EEOP_SCALARARRAYOP */
597  struct
598  {
599  /* element_type/typlen/typbyval/typalign are filled at runtime */
600  Oid element_type; /* InvalidOid if not yet filled */
601  bool useOr; /* use OR or AND semantics? */
602  int16 typlen; /* array element type storage info */
603  bool typbyval;
604  char typalign;
605  FmgrInfo *finfo; /* function's lookup data */
606  FunctionCallInfo fcinfo_data; /* arguments etc */
607  /* faster to access without additional indirection: */
608  PGFunction fn_addr; /* actual call address */
610 
611  /* for EEOP_HASHED_SCALARARRAYOP */
612  struct
613  {
614  bool has_nulls;
615  bool inclause; /* true for IN and false for NOT IN */
617  FmgrInfo *finfo; /* function's lookup data */
618  FunctionCallInfo fcinfo_data; /* arguments etc */
621 
622  /* for EEOP_XMLEXPR */
623  struct
624  {
625  XmlExpr *xexpr; /* original expression node */
626  /* workspace for evaluating named args, if any */
629  /* workspace for evaluating unnamed args, if any */
631  bool *argnull;
633 
634  /* for EEOP_JSON_CONSTRUCTOR */
635  struct
636  {
639 
640  /* for EEOP_AGGREF */
641  struct
642  {
643  int aggno;
645 
646  /* for EEOP_GROUPING_FUNC */
647  struct
648  {
649  List *clauses; /* integer list of column numbers */
651 
652  /* for EEOP_WINDOW_FUNC */
653  struct
654  {
655  /* out-of-line state, modified by nodeWindowAgg.c */
658 
659  /* for EEOP_SUBPLAN */
660  struct
661  {
662  /* out-of-line state, created by nodeSubplan.c */
665 
666  /* for EEOP_AGG_*DESERIALIZE */
667  struct
668  {
670  int jumpnull;
672 
673  /* for EEOP_AGG_STRICT_INPUT_CHECK_NULLS / STRICT_INPUT_CHECK_ARGS */
674  struct
675  {
676  /*
677  * For EEOP_AGG_STRICT_INPUT_CHECK_ARGS args contains pointers to
678  * the NullableDatums that need to be checked for NULLs.
679  *
680  * For EEOP_AGG_STRICT_INPUT_CHECK_NULLS nulls contains pointers
681  * to booleans that need to be checked for NULLs.
682  *
683  * Both cases currently need to exist because sometimes the
684  * to-be-checked nulls are in TupleTableSlot.isnull array, and
685  * sometimes in FunctionCallInfoBaseData.args[i].isnull.
686  */
688  bool *nulls;
689  int nargs;
690  int jumpnull;
692 
693  /* for EEOP_AGG_PLAIN_PERGROUP_NULLCHECK */
694  struct
695  {
696  int setoff;
697  int jumpnull;
699 
700  /* for EEOP_AGG_PRESORTED_DISTINCT_{SINGLE,MULTI} */
701  struct
702  {
707 
708  /* for EEOP_AGG_PLAIN_TRANS_[INIT_][STRICT_]{BYVAL,BYREF} */
709  /* for EEOP_AGG_ORDERED_TRANS_{DATUM,TUPLE} */
710  struct
711  {
714  int setno;
715  int transno;
716  int setoff;
718 
719  /* for EEOP_IS_JSON */
720  struct
721  {
722  JsonIsPredicate *pred; /* original expression node */
724 
725  /* for EEOP_JSONEXPR_PATH */
726  struct
727  {
730 
731  /* for EEOP_JSONEXPR_COERCION */
732  struct
733  {
737  /* exists_* fields only relevant for JSON_EXISTS_OP. */
744  } d;
746 
747 /* Enforce the size rule given in the comment above */
749  "size of ExprEvalStep exceeds 64 bytes");
750 
751 
752 /* Non-inline data for container operations */
753 typedef struct SubscriptingRefState
754 {
755  bool isassignment; /* is it assignment, or just fetch? */
756 
757  /* workspace for type-specific subscripting code */
758  void *workspace;
759 
760  /* numupper and upperprovided[] are filled at expression compile time */
761  /* at runtime, subscripts are computed in upperindex[]/upperindexnull[] */
762  int numupper;
763  bool *upperprovided; /* indicates if this position is supplied */
766 
767  /* similarly for lower indexes, if any */
768  int numlower;
772 
773  /* for assignment, new value to assign is evaluated into here */
776 
777  /* if we have a nested assignment, sbs_fetch_old puts old value here */
779  bool prevnull;
781 
782 /* Execution step methods used for SubscriptingRef */
783 typedef struct SubscriptExecSteps
784 {
785  /* See nodes/subscripting.h for more detail about these */
787  ExecEvalSubroutine sbs_fetch; /* fetch an element */
788  ExecEvalSubroutine sbs_assign; /* assign to an element */
789  ExecEvalSubroutine sbs_fetch_old; /* fetch old value for assignment */
791 
792 /* EEOP_JSON_CONSTRUCTOR state, too big to inline */
794 {
797  bool *arg_nulls;
799  struct
800  {
801  int category;
803  } *arg_type_cache; /* cache for datum_to_json[b]() */
804  int nargs;
806 
807 
808 /* functions in execExpr.c */
809 extern void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s);
810 
811 /* functions in execExprInterp.c */
814 
815 extern Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull);
816 extern void CheckExprStillValid(ExprState *state, ExprContext *econtext);
817 
818 /*
819  * Non fast-path execution functions. These are externs instead of statics in
820  * execExprInterp.c, because that allows them to be used by other methods of
821  * expression evaluation, reducing code duplication.
822  */
824  ExprContext *econtext);
826  ExprContext *econtext);
828  ExprContext *econtext);
829 extern void ExecEvalParamSet(ExprState *state, ExprEvalStep *op,
830  ExprContext *econtext);
832  ExprContext *econtext);
837 extern void ExecEvalRowNull(ExprState *state, ExprEvalStep *op,
838  ExprContext *econtext);
840  ExprContext *econtext);
841 extern void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op);
843  ExprContext *econtext);
844 extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
845 extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
847  ExprContext *econtext);
849  ExprContext *econtext);
851  ExprContext *econtext);
853  ExprContext *econtext);
856  ExprContext *econtext);
859 extern void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op);
861  ExprContext *econtext);
864  ExprContext *econtext);
866  ExprContext *econtext);
870  ExprContext *econtext);
871 extern void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op,
872  ExprContext *econtext);
874  ExprContext *econtext);
875 extern void ExecEvalSysVar(ExprState *state, ExprEvalStep *op,
876  ExprContext *econtext, TupleTableSlot *slot);
877 
878 extern void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup,
879  ExprContext *aggcontext);
880 extern Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans,
881  Datum newValue, bool newValueIsNull,
882  Datum oldValue, bool oldValueIsNull);
883 extern bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate,
884  AggStatePerTrans pertrans);
885 extern bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate,
886  AggStatePerTrans pertrans);
888  ExprContext *econtext);
890  ExprContext *econtext);
891 
892 #endif /* EXEC_EXPR_H */
int16 AttrNumber
Definition: attnum.h:21
signed short int16
Definition: c.h:495
signed int int32
Definition: c.h:496
unsigned char bool
Definition: c.h:459
void ExecEvalParamExtern(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFieldStoreForm(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalGroupingFunc(ExprState *state, ExprEvalStep *op)
struct SubscriptExecSteps SubscriptExecSteps
void ExecEvalRow(ExprState *state, ExprEvalStep *op)
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)
struct SubscriptingRefState SubscriptingRefState
void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalParamSet(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalCoerceViaIOSafe(ExprState *state, ExprEvalStep *op)
Datum ExecInterpExprStillValid(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)
int ExecEvalJsonExprPath(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalConstraintNotNull(ExprState *state, ExprEvalStep *op)
void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s)
Definition: execExpr.c:2582
void ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
void ExecEvalAggOrderedTransDatum(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalParamExec(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonCoercion(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
struct ExprEvalRowtypeCache ExprEvalRowtypeCache
void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup, ExprContext *aggcontext)
void ExecEvalNextValueExpr(ExprState *state, ExprEvalStep *op)
void ExecEvalSysVar(ExprState *state, ExprEvalStep *op, ExprContext *econtext, TupleTableSlot *slot)
void ExecEvalMinMax(ExprState *state, ExprEvalStep *op)
void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalJsonIsPredicate(ExprState *state, ExprEvalStep *op)
bool(* ExecEvalBoolSubroutine)(ExprState *state, struct ExprEvalStep *op, ExprContext *econtext)
Definition: execExpr.h:39
Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans, Datum newValue, bool newValueIsNull, Datum oldValue, bool oldValueIsNull)
struct ExprEvalStep ExprEvalStep
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)
void ExecEvalRowNotNull(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
ExprEvalOp ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
void(* ExecEvalSubroutine)(ExprState *state, struct ExprEvalStep *op, ExprContext *econtext)
Definition: execExpr.h:34
ExprEvalOp
Definition: execExpr.h:67
@ EEOP_ASSIGN_TMP
Definition: execExpr.h:99
@ EEOP_SUBPLAN
Definition: execExpr.h:259
@ EEOP_CONVERT_ROWTYPE
Definition: execExpr.h:246
@ EEOP_FUNCEXPR_STRICT_FUSAGE
Definition: execExpr.h:114
@ EEOP_ARRAYEXPR
Definition: execExpr.h:181
@ EEOP_JSONEXPR_PATH
Definition: execExpr.h:252
@ EEOP_NOT_DISTINCT
Definition: execExpr.h:176
@ EEOP_DOMAIN_TESTVAL
Definition: execExpr.h:230
@ EEOP_PARAM_EXTERN
Definition: execExpr.h:161
@ EEOP_HASHDATUM_NEXT32_STRICT
Definition: execExpr.h:243
@ EEOP_IOCOERCE_SAFE
Definition: execExpr.h:174
@ EEOP_BOOL_AND_STEP
Definition: execExpr.h:123
@ EEOP_WHOLEROW
Definition: execExpr.h:87
@ EEOP_JSONEXPR_COERCION_FINISH
Definition: execExpr.h:254
@ EEOP_HASHDATUM_FIRST_STRICT
Definition: execExpr.h:241
@ EEOP_AGGREF
Definition: execExpr.h:255
@ EEOP_INNER_VAR
Definition: execExpr.h:77
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
Definition: execExpr.h:266
@ EEOP_HASHDATUM_NEXT32
Definition: execExpr.h:242
@ EEOP_ROWCOMPARE_FINAL
Definition: execExpr.h:192
@ EEOP_AGG_STRICT_DESERIALIZE
Definition: execExpr.h:262
@ EEOP_IOCOERCE
Definition: execExpr.h:173
@ EEOP_GROUPING_FUNC
Definition: execExpr.h:256
@ EEOP_DOMAIN_CHECK
Definition: execExpr.h:236
@ EEOP_BOOLTEST_IS_NOT_FALSE
Definition: execExpr.h:157
@ EEOP_PARAM_SET
Definition: execExpr.h:164
@ EEOP_NEXTVALUEEXPR
Definition: execExpr.h:180
@ EEOP_DONE
Definition: execExpr.h:69
@ EEOP_AGG_PLAIN_TRANS_BYREF
Definition: execExpr.h:272
@ EEOP_QUAL
Definition: execExpr.h:135
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
Definition: execExpr.h:274
@ EEOP_AGG_PLAIN_TRANS_BYVAL
Definition: execExpr.h:269
@ EEOP_SCAN_VAR
Definition: execExpr.h:79
@ EEOP_BOOL_NOT_STEP
Definition: execExpr.h:132
@ EEOP_ASSIGN_SCAN_VAR
Definition: execExpr.h:96
@ EEOP_SCAN_SYSVAR
Definition: execExpr.h:84
@ EEOP_SCALARARRAYOP
Definition: execExpr.h:247
@ EEOP_DOMAIN_NOTNULL
Definition: execExpr.h:233
@ EEOP_WINDOW_FUNC
Definition: execExpr.h:257
@ EEOP_INNER_FETCHSOME
Definition: execExpr.h:72
@ EEOP_NULLTEST_ROWISNOTNULL
Definition: execExpr.h:151
@ EEOP_ASSIGN_OUTER_VAR
Definition: execExpr.h:95
@ EEOP_ROW
Definition: execExpr.h:183
@ EEOP_MAKE_READONLY
Definition: execExpr.h:170
@ EEOP_FIELDSTORE_FORM
Definition: execExpr.h:211
@ EEOP_SBSREF_SUBSCRIPTS
Definition: execExpr.h:214
@ EEOP_SBSREF_FETCH
Definition: execExpr.h:227
@ EEOP_FUNCEXPR_STRICT
Definition: execExpr.h:112
@ EEOP_NULLIF
Definition: execExpr.h:177
@ EEOP_CURRENTOFEXPR
Definition: execExpr.h:179
@ EEOP_INNER_SYSVAR
Definition: execExpr.h:82
@ EEOP_ASSIGN_TMP_MAKE_RO
Definition: execExpr.h:101
@ EEOP_CONST
Definition: execExpr.h:104
@ EEOP_BOOL_OR_STEP_LAST
Definition: execExpr.h:129
@ EEOP_JSONEXPR_COERCION
Definition: execExpr.h:253
@ EEOP_BOOL_OR_STEP_FIRST
Definition: execExpr.h:127
@ EEOP_XMLEXPR
Definition: execExpr.h:249
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
Definition: execExpr.h:265
@ EEOP_SBSREF_ASSIGN
Definition: execExpr.h:224
@ EEOP_OUTER_SYSVAR
Definition: execExpr.h:83
@ EEOP_ASSIGN_INNER_VAR
Definition: execExpr.h:94
@ EEOP_BOOL_OR_STEP
Definition: execExpr.h:128
@ EEOP_OUTER_FETCHSOME
Definition: execExpr.h:73
@ EEOP_AGG_STRICT_INPUT_CHECK_ARGS
Definition: execExpr.h:264
@ EEOP_NULLTEST_ROWISNULL
Definition: execExpr.h:150
@ EEOP_BOOLTEST_IS_TRUE
Definition: execExpr.h:154
@ EEOP_FUNCEXPR
Definition: execExpr.h:111
@ EEOP_NULLTEST_ISNOTNULL
Definition: execExpr.h:147
@ EEOP_ROWCOMPARE_STEP
Definition: execExpr.h:189
@ EEOP_MERGE_SUPPORT_FUNC
Definition: execExpr.h:258
@ EEOP_AGG_DESERIALIZE
Definition: execExpr.h:263
@ EEOP_LAST
Definition: execExpr.h:279
@ EEOP_HASHDATUM_FIRST
Definition: execExpr.h:240
@ EEOP_DISTINCT
Definition: execExpr.h:175
@ EEOP_JUMP_IF_NOT_TRUE
Definition: execExpr.h:143
@ EEOP_FUNCEXPR_FUSAGE
Definition: execExpr.h:113
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
Definition: execExpr.h:273
@ EEOP_BOOL_AND_STEP_FIRST
Definition: execExpr.h:122
@ EEOP_JUMP
Definition: execExpr.h:138
@ EEOP_PARAM_CALLBACK
Definition: execExpr.h:162
@ EEOP_BOOL_AND_STEP_LAST
Definition: execExpr.h:124
@ EEOP_AGG_ORDERED_TRANS_DATUM
Definition: execExpr.h:275
@ EEOP_SBSREF_OLD
Definition: execExpr.h:221
@ EEOP_SQLVALUEFUNCTION
Definition: execExpr.h:178
@ EEOP_HASHDATUM_SET_INITVAL
Definition: execExpr.h:239
@ EEOP_JUMP_IF_NOT_NULL
Definition: execExpr.h:142
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
Definition: execExpr.h:271
@ EEOP_FIELDSTORE_DEFORM
Definition: execExpr.h:204
@ EEOP_BOOLTEST_IS_FALSE
Definition: execExpr.h:156
@ EEOP_BOOLTEST_IS_NOT_TRUE
Definition: execExpr.h:155
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL
Definition: execExpr.h:267
@ EEOP_PARAM_EXEC
Definition: execExpr.h:160
@ EEOP_JSON_CONSTRUCTOR
Definition: execExpr.h:250
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
Definition: execExpr.h:268
@ EEOP_NULLTEST_ISNULL
Definition: execExpr.h:146
@ EEOP_MINMAX
Definition: execExpr.h:195
@ EEOP_JUMP_IF_NULL
Definition: execExpr.h:141
@ EEOP_ARRAYCOERCE
Definition: execExpr.h:182
@ EEOP_FIELDSELECT
Definition: execExpr.h:198
@ EEOP_CASE_TESTVAL
Definition: execExpr.h:167
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
Definition: execExpr.h:270
@ EEOP_HASHED_SCALARARRAYOP
Definition: execExpr.h:248
@ EEOP_OUTER_VAR
Definition: execExpr.h:78
@ EEOP_AGG_ORDERED_TRANS_TUPLE
Definition: execExpr.h:276
@ EEOP_SCAN_FETCHSOME
Definition: execExpr.h:74
@ EEOP_IS_JSON
Definition: execExpr.h:251
void ExecEvalConstraintCheck(ExprState *state, ExprEvalStep *op)
StaticAssertDecl(sizeof(ExprEvalStep)<=64, "size of ExprEvalStep exceeds 64 bytes")
void ExecEvalArrayCoerce(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFuncExprStrictFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalFuncExprFusage(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op)
bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate, AggStatePerTrans pertrans)
struct JsonConstructorExprState JsonConstructorExprState
void ExecEvalAggOrderedTransTuple(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
Datum(* PGFunction)(FunctionCallInfo fcinfo)
Definition: fmgr.h:40
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
MinMaxOp
Definition: primnodes.h:1501
RowCompareType
Definition: primnodes.h:1453
XmlExpr * xexpr
Definition: execExpr.h:625
JsonIsPredicate * pred
Definition: execExpr.h:722
Datum * value
Definition: execExpr.h:415
struct ExprEvalStep::@52::@62 jump
Var * var
Definition: execExpr.h:329
void * paramarg
Definition: execExpr.h:407
bool * anynull
Definition: execExpr.h:373
ExprState * elemexprstate
Definition: execExpr.h:466
MinMaxOp op
Definition: execExpr.h:507
bool typbyval
Definition: execExpr.h:603
char elemalign
Definition: execExpr.h:459
struct ExprEvalStep::@52::@68 iocoerce
struct ExprEvalStep::@52::@81 domaincheck
struct ExprEvalStep::@52::@56 assign_var
struct ExprEvalStep::@52::@95 agg_plain_pergroup_nullcheck
struct ExprEvalStep::@52::@78 fieldstore
List * clauses
Definition: execExpr.h:649
WindowFuncExprState * wfstate
Definition: execExpr.h:656
void * json_coercion_cache
Definition: execExpr.h:741
ExecEvalBoolSubroutine subscriptfunc
Definition: execExpr.h:541
struct ExprEvalStep::@52::@97 agg_trans
bool exists_coerce
Definition: execExpr.h:738
struct ExprEvalStep::@52::@75 rowcompare_final
TupleDesc tupdesc
Definition: execExpr.h:332
Oid seqtypid
Definition: execExpr.h:447
ExprEvalRowtypeCache * rowcache
Definition: execExpr.h:530
int last_var
Definition: execExpr.h:308
JunkFilter * junkFilter
Definition: execExpr.h:333
struct ExprEvalStep::@52::@96 agg_presorted_distinctcheck
FmgrInfo * finfo_out
Definition: execExpr.h:430
struct ExprEvalStep::@52::@77 fieldselect
AttrNumber fieldnum
Definition: execExpr.h:516
struct ExprEvalStep::@52::@53 fetch
bool has_nulls
Definition: execExpr.h:614
struct ExprEvalStep::@52::@92 subplan
Datum * values
Definition: execExpr.h:503
bool * elemnulls
Definition: execExpr.h:454
bool * checknull
Definition: execExpr.h:562
int ncolumns
Definition: execExpr.h:535
bool * named_argnull
Definition: execExpr.h:628
Oid outputtype
Definition: execExpr.h:589
struct ScalarArrayOpExprHashTable * elements_tab
Definition: execExpr.h:616
bool inclause
Definition: execExpr.h:615
struct SubscriptingRefState * state
Definition: execExpr.h:543
struct ExprEvalStep::@52::@90 grouping_func
RowCompareType rctype
Definition: execExpr.h:496
SubPlanState * sstate
Definition: execExpr.h:663
bool multidims
Definition: execExpr.h:460
bool exists_cast_to_int
Definition: execExpr.h:739
int16 elemlength
Definition: execExpr.h:457
struct ExprEvalStep::@52::@79 sbsref_subscript
AggStatePerTrans pertrans
Definition: execExpr.h:703
struct ExprEvalStep::@52::@59 func
struct ExprEvalStep::@52::@67 make_readonly
struct ExprEvalStep::@52::@80 sbsref
struct JsonExprState * jsestate
Definition: execExpr.h:728
bool * isnull
Definition: execExpr.h:416
TupleConversionMap * map
Definition: execExpr.h:593
bool * argnull
Definition: execExpr.h:631
struct ExprEvalStep::@52::@61 qualexpr
intptr_t opcode
Definition: execExpr.h:290
Oid inputtype
Definition: execExpr.h:588
struct ExprEvalStep::@52::@91 window_func
char typalign
Definition: execExpr.h:604
ExecEvalSubroutine paramfunc
Definition: execExpr.h:406
FunctionCallInfo fcinfo_data_in
Definition: execExpr.h:434
bool elembyval
Definition: execExpr.h:458
struct ExprEvalStep::@52::@98 is_json
PGFunction fn_addr
Definition: execExpr.h:366
TupleDesc known_desc
Definition: execExpr.h:312
NullableDatum * args
Definition: execExpr.h:687
int resultnum
Definition: execExpr.h:340
bool * nulls
Definition: execExpr.h:504
Datum * resvalue
Definition: execExpr.h:293
struct ExprEvalStep::@52::@82 hashdatum_initvalue
struct ExprEvalStep::@52::@70 nextvalueexpr
Datum * elemvalues
Definition: execExpr.h:453
struct ExprEvalStep::@52::@84 convert_rowtype
int jumpnull
Definition: execExpr.h:488
Oid resulttype
Definition: execExpr.h:517
ExprEvalRowtypeCache * incache
Definition: execExpr.h:591
bool exists_check_domain
Definition: execExpr.h:740
ScalarArrayOpExpr * saop
Definition: execExpr.h:619
const TupleTableSlotOps * kind
Definition: execExpr.h:314
Oid resultelemtype
Definition: execExpr.h:467
struct ExprEvalStep::@52::@63 nulltest_row
FunctionCallInfo fcinfo_data
Definition: execExpr.h:364
int jumpdistinct
Definition: execExpr.h:705
Datum * checkvalue
Definition: execExpr.h:561
struct ExprEvalStep::@52::@54 var
FmgrInfo * finfo_in
Definition: execExpr.h:433
int jumpdone
Definition: execExpr.h:374
Datum * named_argvalue
Definition: execExpr.h:627
struct ExprEvalStep::@52::@65 cparam
struct ExprEvalStep::@52::@76 minmax
struct ExprEvalStep::@52::@55 wholerow
ErrorSaveContext * escontext
Definition: execExpr.h:565
Oid paramtype
Definition: execExpr.h:400
struct ExprEvalStep::@52::@87 xmlexpr
struct ExprEvalStep::@52::@100 jsonexpr_coercion
bool fixed
Definition: execExpr.h:310
union ExprEvalStep::@52 d
struct ExprEvalStep::@52::@57 assign_tmp
struct ExprEvalStep::@52::@72 arraycoerce
Datum value
Definition: execExpr.h:356
bool useOr
Definition: execExpr.h:601
int32 targettypmod
Definition: execExpr.h:735
struct ExprEvalStep::@52::@58 constval
struct ExprEvalStep::@52::@86 hashedscalararrayop
FieldStore * fstore
Definition: execExpr.h:526
struct ExprEvalStep::@52::@99 jsonexpr
bool * resnull
Definition: execExpr.h:294
FunctionCallInfo fcinfo_data_out
Definition: execExpr.h:431
ExecEvalSubroutine subscriptfunc
Definition: execExpr.h:550
struct ExprEvalStep::@52::@94 agg_strict_input_check
ExprEvalRowtypeCache * outcache
Definition: execExpr.h:592
int16 typlen
Definition: execExpr.h:602
Datum * argvalue
Definition: execExpr.h:630
struct ExprEvalStep::@52::@74 rowcompare_step
struct ExprEvalStep::@52::@85 scalararrayop
struct ExprEvalStep::@52::@89 aggref
struct ExprEvalStep::@52::@93 agg_deserialize
ExprEvalRowtypeCache rowcache
Definition: execExpr.h:393
Datum init_value
Definition: execExpr.h:571
struct JsonConstructorExprState * jcstate
Definition: execExpr.h:637
struct ExprEvalStep::@52::@66 casetest
FmgrInfo * finfo
Definition: execExpr.h:363
bool isnull
Definition: execExpr.h:357
ExprContext * aggcontext
Definition: execExpr.h:704
Oid elemtype
Definition: execExpr.h:456
struct ExprEvalStep::@52::@69 sqlvaluefunction
struct ExprEvalStep::@52::@83 hashdatum
char * constraintname
Definition: execExpr.h:559
struct ExprEvalStep::@52::@60 boolexpr
struct ExprEvalStep::@52::@88 json_constructor
struct ExprEvalStep::@52::@73 row
Oid element_type
Definition: execExpr.h:600
struct ExprEvalStep::@52::@64 param
Oid targettype
Definition: execExpr.h:734
struct ExprEvalStep::@52::@71 arrayexpr
bool first
Definition: execExpr.h:330
struct ArrayMapState * amstate
Definition: execExpr.h:468
bool omit_quotes
Definition: execExpr.h:736
SQLValueFunction * svf
Definition: execExpr.h:440
Definition: fmgr.h:57
JsonConstructorExpr * constructor
Definition: execExpr.h:795
struct JsonConstructorExprState::@101 * arg_type_cache
Definition: pg_list.h:54
ExecEvalSubroutine sbs_fetch_old
Definition: execExpr.h:789
ExecEvalBoolSubroutine sbs_check_subscripts
Definition: execExpr.h:786
ExecEvalSubroutine sbs_assign
Definition: execExpr.h:788
ExecEvalSubroutine sbs_fetch
Definition: execExpr.h:787
Definition: primnodes.h:248
Definition: regguts.h:323