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 
164  /* return CaseTestExpr value */
166 
167  /* apply MakeExpandedObjectReadOnly() to target value */
169 
170  /* evaluate assorted special-purpose expression types */
182 
183  /*
184  * Compare two individual elements of each of two compared ROW()
185  * expressions. Skip to ROWCOMPARE_FINAL if elements are not equal.
186  */
188 
189  /* evaluate boolean value based on previous ROWCOMPARE_STEP operations */
191 
192  /* evaluate GREATEST() or LEAST() */
194 
195  /* evaluate FieldSelect expression */
197 
198  /*
199  * Deform tuple before evaluating new values for individual fields in a
200  * FieldStore expression.
201  */
203 
204  /*
205  * Form the new tuple for a FieldStore expression. Individual fields will
206  * have been evaluated into columns of the tuple deformed by the preceding
207  * DEFORM step.
208  */
210 
211  /* Process container subscripts; possibly short-circuit result to NULL */
213 
214  /*
215  * Compute old container element/slice when a SubscriptingRef assignment
216  * expression contains SubscriptingRef/FieldStore subexpressions. Value is
217  * accessed using the CaseTest mechanism.
218  */
220 
221  /* compute new value for SubscriptingRef assignment expression */
223 
224  /* compute element/slice for SubscriptingRef fetch expression */
226 
227  /* evaluate value for CoerceToDomainValue */
229 
230  /* evaluate a domain's NOT NULL constraint */
232 
233  /* evaluate a single domain CHECK constraint */
235 
236  /* evaluate assorted special-purpose expression types */
251 
252  /* aggregation related nodes */
268 
269  /* non-existent operation, used e.g. to check array lengths */
270  EEOP_LAST
272 
273 
274 typedef struct ExprEvalStep
275 {
276  /*
277  * Instruction to be executed. During instruction preparation this is an
278  * enum ExprEvalOp, but later it can be changed to some other type, e.g. a
279  * pointer for computed goto (that's why it's an intptr_t).
280  */
281  intptr_t opcode;
282 
283  /* where to store the result of this step */
285  bool *resnull;
286 
287  /*
288  * Inline data for the operation. Inline data is faster to access, but
289  * also bloats the size of all instructions. The union should be kept to
290  * no more than 40 bytes on 64-bit systems (so that the entire struct is
291  * no more than 64 bytes, a single cacheline on common systems).
292  */
293  union
294  {
295  /* for EEOP_INNER/OUTER/SCAN_FETCHSOME */
296  struct
297  {
298  /* attribute number up to which to fetch (inclusive) */
299  int last_var;
300  /* will the type of slot be the same for every invocation */
301  bool fixed;
302  /* tuple descriptor, if known */
304  /* type of slot, can only be relied upon if fixed is set */
306  } fetch;
307 
308  /* for EEOP_INNER/OUTER/SCAN_[SYS]VAR[_FIRST] */
309  struct
310  {
311  /* attnum is attr number - 1 for regular VAR ... */
312  /* but it's just the normal (negative) attr number for SYSVAR */
313  int attnum;
314  Oid vartype; /* type OID of variable */
315  } var;
316 
317  /* for EEOP_WHOLEROW */
318  struct
319  {
320  Var *var; /* original Var node in plan tree */
321  bool first; /* first time through, need to initialize? */
322  bool slow; /* need runtime check for nulls? */
323  TupleDesc tupdesc; /* descriptor for resulting tuples */
324  JunkFilter *junkFilter; /* JunkFilter to remove resjunk cols */
326 
327  /* for EEOP_ASSIGN_*_VAR */
328  struct
329  {
330  /* target index in ExprState->resultslot->tts_values/nulls */
332  /* source attribute number - 1 */
333  int attnum;
335 
336  /* for EEOP_ASSIGN_TMP[_MAKE_RO] */
337  struct
338  {
339  /* target index in ExprState->resultslot->tts_values/nulls */
340  int resultnum;
342 
343  /* for EEOP_CONST */
344  struct
345  {
346  /* constant's value */
348  bool isnull;
350 
351  /* for EEOP_FUNCEXPR_* / NULLIF / DISTINCT */
352  struct
353  {
354  FmgrInfo *finfo; /* function's lookup data */
355  FunctionCallInfo fcinfo_data; /* arguments etc */
356  /* faster to access without additional indirection: */
357  PGFunction fn_addr; /* actual call address */
358  int nargs; /* number of arguments */
359  } func;
360 
361  /* for EEOP_BOOL_*_STEP */
362  struct
363  {
364  bool *anynull; /* track if any input was NULL */
365  int jumpdone; /* jump here if result determined */
367 
368  /* for EEOP_QUAL */
369  struct
370  {
371  int jumpdone; /* jump here on false or null */
373 
374  /* for EEOP_JUMP[_CONDITION] */
375  struct
376  {
377  int jumpdone; /* target instruction's index */
378  } jump;
379 
380  /* for EEOP_NULLTEST_ROWIS[NOT]NULL */
381  struct
382  {
383  /* cached descriptor for composite type - filled at runtime */
386 
387  /* for EEOP_PARAM_EXEC/EXTERN */
388  struct
389  {
390  int paramid; /* numeric ID for parameter */
391  Oid paramtype; /* OID of parameter's datatype */
392  } param;
393 
394  /* for EEOP_PARAM_CALLBACK */
395  struct
396  {
397  ExecEvalSubroutine paramfunc; /* add-on evaluation subroutine */
398  void *paramarg; /* private data for same */
399  int paramid; /* numeric ID for parameter */
400  Oid paramtype; /* OID of parameter's datatype */
402 
403  /* for EEOP_CASE_TESTVAL/DOMAIN_TESTVAL */
404  struct
405  {
406  Datum *value; /* value to return */
407  bool *isnull;
409 
410  /* for EEOP_MAKE_READONLY */
411  struct
412  {
413  Datum *value; /* value to coerce to read-only */
414  bool *isnull;
416 
417  /* for EEOP_IOCOERCE */
418  struct
419  {
420  /* lookup and call info for source type's output function */
423  /* lookup and call info for result type's input function */
427 
428  /* for EEOP_SQLVALUEFUNCTION */
429  struct
430  {
433 
434  /* for EEOP_NEXTVALUEEXPR */
435  struct
436  {
440 
441  /* for EEOP_ARRAYEXPR */
442  struct
443  {
444  Datum *elemvalues; /* element values get stored here */
445  bool *elemnulls;
446  int nelems; /* length of the above arrays */
447  Oid elemtype; /* array element type */
448  int16 elemlength; /* typlen of the array element type */
449  bool elembyval; /* is the element type pass-by-value? */
450  char elemalign; /* typalign of the element type */
451  bool multidims; /* is array expression multi-D? */
453 
454  /* for EEOP_ARRAYCOERCE */
455  struct
456  {
457  ExprState *elemexprstate; /* null if no per-element work */
458  Oid resultelemtype; /* element type of result array */
459  struct ArrayMapState *amstate; /* workspace for array_map */
461 
462  /* for EEOP_ROW */
463  struct
464  {
465  TupleDesc tupdesc; /* descriptor for result tuples */
466  /* workspace for the values constituting the row: */
467  Datum *elemvalues;
468  bool *elemnulls;
469  } row;
470 
471  /* for EEOP_ROWCOMPARE_STEP */
472  struct
473  {
474  /* lookup and call data for column comparison function */
475  FmgrInfo *finfo;
478  /* target for comparison resulting in NULL */
479  int jumpnull;
480  /* target for comparison yielding inequality */
481  int jumpdone;
483 
484  /* for EEOP_ROWCOMPARE_FINAL */
485  struct
486  {
489 
490  /* for EEOP_MINMAX */
491  struct
492  {
493  /* workspace for argument values */
495  bool *nulls;
496  int nelems;
497  /* is it GREATEST or LEAST? */
499  /* lookup and call data for comparison function */
500  FmgrInfo *finfo;
503 
504  /* for EEOP_FIELDSELECT */
505  struct
506  {
507  AttrNumber fieldnum; /* field number to extract */
508  Oid resulttype; /* field's type */
509  /* cached descriptor for composite type - filled at runtime */
512 
513  /* for EEOP_FIELDSTORE_DEFORM / FIELDSTORE_FORM */
514  struct
515  {
516  /* original expression node */
518 
519  /* cached descriptor for composite type - filled at runtime */
520  /* note that a DEFORM and FORM pair share the same cache */
522 
523  /* workspace for column values */
524  Datum *values;
525  bool *nulls;
526  int ncolumns;
528 
529  /* for EEOP_SBSREF_SUBSCRIPTS */
530  struct
531  {
532  ExecEvalBoolSubroutine subscriptfunc; /* evaluation subroutine */
533  /* too big to have inline */
535  int jumpdone; /* jump here on null */
537 
538  /* for EEOP_SBSREF_OLD / ASSIGN / FETCH */
539  struct
540  {
541  ExecEvalSubroutine subscriptfunc; /* evaluation subroutine */
542  /* too big to have inline */
543  struct SubscriptingRefState *state;
545 
546  /* for EEOP_DOMAIN_NOTNULL / DOMAIN_CHECK */
547  struct
548  {
549  /* name of constraint */
551  /* where the result of a CHECK constraint will be stored */
553  bool *checknull;
554  /* OID of domain type */
555  Oid resulttype;
558 
559  /* for EEOP_CONVERT_ROWTYPE */
560  struct
561  {
562  Oid inputtype; /* input composite type */
563  Oid outputtype; /* output composite type */
564  /* these three fields are filled at runtime: */
565  ExprEvalRowtypeCache *incache; /* cache for input type */
566  ExprEvalRowtypeCache *outcache; /* cache for output type */
567  TupleConversionMap *map; /* column mapping */
569 
570  /* for EEOP_SCALARARRAYOP */
571  struct
572  {
573  /* element_type/typlen/typbyval/typalign are filled at runtime */
574  Oid element_type; /* InvalidOid if not yet filled */
575  bool useOr; /* use OR or AND semantics? */
576  int16 typlen; /* array element type storage info */
577  bool typbyval;
578  char typalign;
579  FmgrInfo *finfo; /* function's lookup data */
580  FunctionCallInfo fcinfo_data; /* arguments etc */
581  /* faster to access without additional indirection: */
582  PGFunction fn_addr; /* actual call address */
584 
585  /* for EEOP_HASHED_SCALARARRAYOP */
586  struct
587  {
588  bool has_nulls;
589  bool inclause; /* true for IN and false for NOT IN */
591  FmgrInfo *finfo; /* function's lookup data */
592  FunctionCallInfo fcinfo_data; /* arguments etc */
595 
596  /* for EEOP_XMLEXPR */
597  struct
598  {
599  XmlExpr *xexpr; /* original expression node */
600  /* workspace for evaluating named args, if any */
603  /* workspace for evaluating unnamed args, if any */
605  bool *argnull;
607 
608  /* for EEOP_JSON_CONSTRUCTOR */
609  struct
610  {
613 
614  /* for EEOP_AGGREF */
615  struct
616  {
617  int aggno;
619 
620  /* for EEOP_GROUPING_FUNC */
621  struct
622  {
623  List *clauses; /* integer list of column numbers */
625 
626  /* for EEOP_WINDOW_FUNC */
627  struct
628  {
629  /* out-of-line state, modified by nodeWindowAgg.c */
632 
633  /* for EEOP_SUBPLAN */
634  struct
635  {
636  /* out-of-line state, created by nodeSubplan.c */
639 
640  /* for EEOP_AGG_*DESERIALIZE */
641  struct
642  {
644  int jumpnull;
646 
647  /* for EEOP_AGG_STRICT_INPUT_CHECK_NULLS / STRICT_INPUT_CHECK_ARGS */
648  struct
649  {
650  /*
651  * For EEOP_AGG_STRICT_INPUT_CHECK_ARGS args contains pointers to
652  * the NullableDatums that need to be checked for NULLs.
653  *
654  * For EEOP_AGG_STRICT_INPUT_CHECK_NULLS nulls contains pointers
655  * to booleans that need to be checked for NULLs.
656  *
657  * Both cases currently need to exist because sometimes the
658  * to-be-checked nulls are in TupleTableSlot.isnull array, and
659  * sometimes in FunctionCallInfoBaseData.args[i].isnull.
660  */
662  bool *nulls;
663  int nargs;
664  int jumpnull;
666 
667  /* for EEOP_AGG_PLAIN_PERGROUP_NULLCHECK */
668  struct
669  {
670  int setoff;
671  int jumpnull;
673 
674  /* for EEOP_AGG_PRESORTED_DISTINCT_{SINGLE,MULTI} */
675  struct
676  {
681 
682  /* for EEOP_AGG_PLAIN_TRANS_[INIT_][STRICT_]{BYVAL,BYREF} */
683  /* for EEOP_AGG_ORDERED_TRANS_{DATUM,TUPLE} */
684  struct
685  {
688  int setno;
689  int transno;
690  int setoff;
692 
693  /* for EEOP_IS_JSON */
694  struct
695  {
696  JsonIsPredicate *pred; /* original expression node */
698 
699  /* for EEOP_JSONEXPR_PATH */
700  struct
701  {
704 
705  /* for EEOP_JSONEXPR_COERCION */
706  struct
707  {
713  } d;
715 
716 /* Enforce the size rule given in the comment above */
718  "size of ExprEvalStep exceeds 64 bytes");
719 
720 
721 /* Non-inline data for container operations */
722 typedef struct SubscriptingRefState
723 {
724  bool isassignment; /* is it assignment, or just fetch? */
725 
726  /* workspace for type-specific subscripting code */
727  void *workspace;
728 
729  /* numupper and upperprovided[] are filled at expression compile time */
730  /* at runtime, subscripts are computed in upperindex[]/upperindexnull[] */
731  int numupper;
732  bool *upperprovided; /* indicates if this position is supplied */
735 
736  /* similarly for lower indexes, if any */
737  int numlower;
741 
742  /* for assignment, new value to assign is evaluated into here */
745 
746  /* if we have a nested assignment, sbs_fetch_old puts old value here */
748  bool prevnull;
750 
751 /* Execution step methods used for SubscriptingRef */
752 typedef struct SubscriptExecSteps
753 {
754  /* See nodes/subscripting.h for more detail about these */
756  ExecEvalSubroutine sbs_fetch; /* fetch an element */
757  ExecEvalSubroutine sbs_assign; /* assign to an element */
758  ExecEvalSubroutine sbs_fetch_old; /* fetch old value for assignment */
760 
761 /* EEOP_JSON_CONSTRUCTOR state, too big to inline */
763 {
766  bool *arg_nulls;
768  struct
769  {
770  int category;
772  } *arg_type_cache; /* cache for datum_to_json[b]() */
773  int nargs;
775 
776 
777 /* functions in execExpr.c */
778 extern void ExprEvalPushStep(ExprState *es, const ExprEvalStep *s);
779 
780 /* functions in execExprInterp.c */
783 
784 extern Datum ExecInterpExprStillValid(ExprState *state, ExprContext *econtext, bool *isNull);
785 extern void CheckExprStillValid(ExprState *state, ExprContext *econtext);
786 
787 /*
788  * Non fast-path execution functions. These are externs instead of statics in
789  * execExprInterp.c, because that allows them to be used by other methods of
790  * expression evaluation, reducing code duplication.
791  */
793  ExprContext *econtext);
795  ExprContext *econtext);
797  ExprContext *econtext);
799  ExprContext *econtext);
804 extern void ExecEvalRowNull(ExprState *state, ExprEvalStep *op,
805  ExprContext *econtext);
807  ExprContext *econtext);
808 extern void ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op);
810  ExprContext *econtext);
811 extern void ExecEvalRow(ExprState *state, ExprEvalStep *op);
812 extern void ExecEvalMinMax(ExprState *state, ExprEvalStep *op);
814  ExprContext *econtext);
816  ExprContext *econtext);
818  ExprContext *econtext);
820  ExprContext *econtext);
823  ExprContext *econtext);
826 extern void ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op);
828  ExprContext *econtext);
831  ExprContext *econtext);
833  ExprContext *econtext);
837  ExprContext *econtext);
838 extern void ExecEvalSubPlan(ExprState *state, ExprEvalStep *op,
839  ExprContext *econtext);
841  ExprContext *econtext);
842 extern void ExecEvalSysVar(ExprState *state, ExprEvalStep *op,
843  ExprContext *econtext, TupleTableSlot *slot);
844 
845 extern void ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup pergroup,
846  ExprContext *aggcontext);
847 extern Datum ExecAggCopyTransValue(AggState *aggstate, AggStatePerTrans pertrans,
848  Datum newValue, bool newValueIsNull,
849  Datum oldValue, bool oldValueIsNull);
850 extern bool ExecEvalPreOrderedDistinctSingle(AggState *aggstate,
851  AggStatePerTrans pertrans);
852 extern bool ExecEvalPreOrderedDistinctMulti(AggState *aggstate,
853  AggStatePerTrans pertrans);
855  ExprContext *econtext);
857  ExprContext *econtext);
858 
859 #endif /* EXEC_EXPR_H */
int16 AttrNumber
Definition: attnum.h:21
signed short int16
Definition: c.h:493
signed int int32
Definition: c.h:494
unsigned char bool
Definition: c.h:456
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 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:2591
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:250
@ EEOP_CONVERT_ROWTYPE
Definition: execExpr.h:237
@ EEOP_FUNCEXPR_STRICT_FUSAGE
Definition: execExpr.h:114
@ EEOP_ARRAYEXPR
Definition: execExpr.h:179
@ EEOP_JSONEXPR_PATH
Definition: execExpr.h:243
@ EEOP_NOT_DISTINCT
Definition: execExpr.h:174
@ EEOP_DOMAIN_TESTVAL
Definition: execExpr.h:228
@ EEOP_PARAM_EXTERN
Definition: execExpr.h:161
@ EEOP_IOCOERCE_SAFE
Definition: execExpr.h:172
@ EEOP_BOOL_AND_STEP
Definition: execExpr.h:123
@ EEOP_WHOLEROW
Definition: execExpr.h:87
@ EEOP_JSONEXPR_COERCION_FINISH
Definition: execExpr.h:245
@ EEOP_AGGREF
Definition: execExpr.h:246
@ EEOP_INNER_VAR
Definition: execExpr.h:77
@ EEOP_AGG_PLAIN_PERGROUP_NULLCHECK
Definition: execExpr.h:257
@ EEOP_ROWCOMPARE_FINAL
Definition: execExpr.h:190
@ EEOP_AGG_STRICT_DESERIALIZE
Definition: execExpr.h:253
@ EEOP_IOCOERCE
Definition: execExpr.h:171
@ EEOP_GROUPING_FUNC
Definition: execExpr.h:247
@ EEOP_DOMAIN_CHECK
Definition: execExpr.h:234
@ EEOP_BOOLTEST_IS_NOT_FALSE
Definition: execExpr.h:157
@ EEOP_NEXTVALUEEXPR
Definition: execExpr.h:178
@ EEOP_DONE
Definition: execExpr.h:69
@ EEOP_AGG_PLAIN_TRANS_BYREF
Definition: execExpr.h:263
@ EEOP_QUAL
Definition: execExpr.h:135
@ EEOP_AGG_PRESORTED_DISTINCT_MULTI
Definition: execExpr.h:265
@ EEOP_AGG_PLAIN_TRANS_BYVAL
Definition: execExpr.h:260
@ 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:238
@ EEOP_DOMAIN_NOTNULL
Definition: execExpr.h:231
@ EEOP_WINDOW_FUNC
Definition: execExpr.h:248
@ 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:181
@ EEOP_MAKE_READONLY
Definition: execExpr.h:168
@ EEOP_FIELDSTORE_FORM
Definition: execExpr.h:209
@ EEOP_SBSREF_SUBSCRIPTS
Definition: execExpr.h:212
@ EEOP_SBSREF_FETCH
Definition: execExpr.h:225
@ EEOP_FUNCEXPR_STRICT
Definition: execExpr.h:112
@ EEOP_NULLIF
Definition: execExpr.h:175
@ EEOP_CURRENTOFEXPR
Definition: execExpr.h:177
@ 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:244
@ EEOP_BOOL_OR_STEP_FIRST
Definition: execExpr.h:127
@ EEOP_XMLEXPR
Definition: execExpr.h:240
@ EEOP_AGG_STRICT_INPUT_CHECK_NULLS
Definition: execExpr.h:256
@ EEOP_SBSREF_ASSIGN
Definition: execExpr.h:222
@ 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:255
@ 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:187
@ EEOP_MERGE_SUPPORT_FUNC
Definition: execExpr.h:249
@ EEOP_AGG_DESERIALIZE
Definition: execExpr.h:254
@ EEOP_LAST
Definition: execExpr.h:270
@ EEOP_DISTINCT
Definition: execExpr.h:173
@ EEOP_JUMP_IF_NOT_TRUE
Definition: execExpr.h:143
@ EEOP_FUNCEXPR_FUSAGE
Definition: execExpr.h:113
@ EEOP_AGG_PRESORTED_DISTINCT_SINGLE
Definition: execExpr.h:264
@ 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:266
@ EEOP_SBSREF_OLD
Definition: execExpr.h:219
@ EEOP_SQLVALUEFUNCTION
Definition: execExpr.h:176
@ EEOP_JUMP_IF_NOT_NULL
Definition: execExpr.h:142
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYREF
Definition: execExpr.h:262
@ EEOP_FIELDSTORE_DEFORM
Definition: execExpr.h:202
@ 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:258
@ EEOP_PARAM_EXEC
Definition: execExpr.h:160
@ EEOP_JSON_CONSTRUCTOR
Definition: execExpr.h:241
@ EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL
Definition: execExpr.h:259
@ EEOP_NULLTEST_ISNULL
Definition: execExpr.h:146
@ EEOP_MINMAX
Definition: execExpr.h:193
@ EEOP_JUMP_IF_NULL
Definition: execExpr.h:141
@ EEOP_ARRAYCOERCE
Definition: execExpr.h:180
@ EEOP_FIELDSELECT
Definition: execExpr.h:196
@ EEOP_CASE_TESTVAL
Definition: execExpr.h:165
@ EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF
Definition: execExpr.h:261
@ EEOP_HASHED_SCALARARRAYOP
Definition: execExpr.h:239
@ EEOP_OUTER_VAR
Definition: execExpr.h:78
@ EEOP_AGG_ORDERED_TRANS_TUPLE
Definition: execExpr.h:267
@ EEOP_SCAN_FETCHSOME
Definition: execExpr.h:74
@ EEOP_IS_JSON
Definition: execExpr.h:242
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:1471
RowCompareType
Definition: primnodes.h:1423
XmlExpr * xexpr
Definition: execExpr.h:599
JsonIsPredicate * pred
Definition: execExpr.h:696
Datum * value
Definition: execExpr.h:406
union ExprEvalStep::@54 d
Var * var
Definition: execExpr.h:320
void * paramarg
Definition: execExpr.h:398
bool * anynull
Definition: execExpr.h:364
ExprState * elemexprstate
Definition: execExpr.h:457
MinMaxOp op
Definition: execExpr.h:498
bool typbyval
Definition: execExpr.h:577
struct ExprEvalStep::@54::@80 fieldstore
char elemalign
Definition: execExpr.h:450
List * clauses
Definition: execExpr.h:623
WindowFuncExprState * wfstate
Definition: execExpr.h:630
ExecEvalBoolSubroutine subscriptfunc
Definition: execExpr.h:532
struct ExprEvalStep::@54::@77 rowcompare_final
TupleDesc tupdesc
Definition: execExpr.h:323
Oid seqtypid
Definition: execExpr.h:438
struct ExprEvalStep::@54::@95 agg_plain_pergroup_nullcheck
ExprEvalRowtypeCache * rowcache
Definition: execExpr.h:521
struct ExprEvalStep::@54::@60 constval
int last_var
Definition: execExpr.h:299
JunkFilter * junkFilter
Definition: execExpr.h:324
struct ExprEvalStep::@54::@65 nulltest_row
FmgrInfo * finfo_out
Definition: execExpr.h:421
AttrNumber fieldnum
Definition: execExpr.h:507
bool has_nulls
Definition: execExpr.h:588
Datum * values
Definition: execExpr.h:494
bool * elemnulls
Definition: execExpr.h:445
struct ExprEvalStep::@54::@84 convert_rowtype
struct ExprEvalStep::@54::@71 sqlvaluefunction
bool * checknull
Definition: execExpr.h:553
int ncolumns
Definition: execExpr.h:526
bool * named_argnull
Definition: execExpr.h:602
struct ExprEvalStep::@54::@100 jsonexpr_coercion
Oid outputtype
Definition: execExpr.h:563
struct ScalarArrayOpExprHashTable * elements_tab
Definition: execExpr.h:590
bool inclause
Definition: execExpr.h:589
struct SubscriptingRefState * state
Definition: execExpr.h:534
struct ExprEvalStep::@54::@98 is_json
RowCompareType rctype
Definition: execExpr.h:487
SubPlanState * sstate
Definition: execExpr.h:637
bool multidims
Definition: execExpr.h:451
struct ExprEvalStep::@54::@90 grouping_func
struct ExprEvalStep::@54::@72 nextvalueexpr
struct ExprEvalStep::@54::@96 agg_presorted_distinctcheck
int16 elemlength
Definition: execExpr.h:448
AggStatePerTrans pertrans
Definition: execExpr.h:677
struct ExprEvalStep::@54::@91 window_func
struct JsonExprState * jsestate
Definition: execExpr.h:702
bool * isnull
Definition: execExpr.h:407
TupleConversionMap * map
Definition: execExpr.h:567
bool * argnull
Definition: execExpr.h:605
intptr_t opcode
Definition: execExpr.h:281
Oid inputtype
Definition: execExpr.h:562
char typalign
Definition: execExpr.h:578
ExecEvalSubroutine paramfunc
Definition: execExpr.h:397
FunctionCallInfo fcinfo_data_in
Definition: execExpr.h:425
bool elembyval
Definition: execExpr.h:449
struct ExprEvalStep::@54::@92 subplan
struct ExprEvalStep::@54::@70 iocoerce
PGFunction fn_addr
Definition: execExpr.h:357
TupleDesc known_desc
Definition: execExpr.h:303
NullableDatum * args
Definition: execExpr.h:661
int resultnum
Definition: execExpr.h:331
struct ExprEvalStep::@54::@56 var
bool * nulls
Definition: execExpr.h:495
Datum * resvalue
Definition: execExpr.h:284
Datum * elemvalues
Definition: execExpr.h:444
int jumpnull
Definition: execExpr.h:479
Oid resulttype
Definition: execExpr.h:508
ExprEvalRowtypeCache * incache
Definition: execExpr.h:565
ScalarArrayOpExpr * saop
Definition: execExpr.h:593
const TupleTableSlotOps * kind
Definition: execExpr.h:305
Oid resultelemtype
Definition: execExpr.h:458
FunctionCallInfo fcinfo_data
Definition: execExpr.h:355
int jumpdistinct
Definition: execExpr.h:679
Datum * checkvalue
Definition: execExpr.h:552
FmgrInfo * finfo_in
Definition: execExpr.h:424
int jumpdone
Definition: execExpr.h:365
Datum * named_argvalue
Definition: execExpr.h:601
struct ExprEvalStep::@54::@82 sbsref
struct ExprEvalStep::@54::@78 minmax
struct ExprEvalStep::@54::@69 make_readonly
struct ExprEvalStep::@54::@67 cparam
ErrorSaveContext * escontext
Definition: execExpr.h:556
Oid paramtype
Definition: execExpr.h:391
struct ExprEvalStep::@54::@57 wholerow
struct ExprEvalStep::@54::@62 boolexpr
struct ExprEvalStep::@54::@94 agg_strict_input_check
bool fixed
Definition: execExpr.h:301
struct ExprEvalStep::@54::@64 jump
struct ExprEvalStep::@54::@59 assign_tmp
struct ExprEvalStep::@54::@87 xmlexpr
Datum value
Definition: execExpr.h:347
struct ExprEvalStep::@54::@76 rowcompare_step
struct ExprEvalStep::@54::@75 row
void * json_populate_type_cache
Definition: execExpr.h:710
struct ExprEvalStep::@54::@58 assign_var
bool useOr
Definition: execExpr.h:575
int32 targettypmod
Definition: execExpr.h:709
struct ExprEvalStep::@54::@99 jsonexpr
struct ExprEvalStep::@54::@61 func
FieldStore * fstore
Definition: execExpr.h:517
bool * resnull
Definition: execExpr.h:285
struct ExprEvalStep::@54::@88 json_constructor
struct ExprEvalStep::@54::@74 arraycoerce
FunctionCallInfo fcinfo_data_out
Definition: execExpr.h:422
struct ExprEvalStep::@54::@93 agg_deserialize
ExecEvalSubroutine subscriptfunc
Definition: execExpr.h:541
ExprEvalRowtypeCache * outcache
Definition: execExpr.h:566
int16 typlen
Definition: execExpr.h:576
Datum * argvalue
Definition: execExpr.h:604
struct ExprEvalStep::@54::@63 qualexpr
struct ExprEvalStep::@54::@73 arrayexpr
struct ExprEvalStep::@54::@89 aggref
ExprEvalRowtypeCache rowcache
Definition: execExpr.h:384
struct ExprEvalStep::@54::@97 agg_trans
struct ExprEvalStep::@54::@83 domaincheck
struct JsonConstructorExprState * jcstate
Definition: execExpr.h:611
FmgrInfo * finfo
Definition: execExpr.h:354
struct ExprEvalStep::@54::@79 fieldselect
bool isnull
Definition: execExpr.h:348
ExprContext * aggcontext
Definition: execExpr.h:678
Oid elemtype
Definition: execExpr.h:447
struct ExprEvalStep::@54::@68 casetest
char * constraintname
Definition: execExpr.h:550
struct ExprEvalStep::@54::@55 fetch
Oid element_type
Definition: execExpr.h:574
struct ExprEvalStep::@54::@85 scalararrayop
Oid targettype
Definition: execExpr.h:708
struct ExprEvalStep::@54::@81 sbsref_subscript
bool first
Definition: execExpr.h:321
struct ArrayMapState * amstate
Definition: execExpr.h:459
SQLValueFunction * svf
Definition: execExpr.h:431
struct ExprEvalStep::@54::@66 param
struct ExprEvalStep::@54::@86 hashedscalararrayop
Definition: fmgr.h:57
JsonConstructorExpr * constructor
Definition: execExpr.h:764
struct JsonConstructorExprState::@101 * arg_type_cache
Definition: pg_list.h:54
ExecEvalSubroutine sbs_fetch_old
Definition: execExpr.h:758
ExecEvalBoolSubroutine sbs_check_subscripts
Definition: execExpr.h:755
ExecEvalSubroutine sbs_assign
Definition: execExpr.h:757
ExecEvalSubroutine sbs_fetch
Definition: execExpr.h:756
Definition: primnodes.h:248
Definition: regguts.h:323