diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/nodes/execnodes.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index eaea1f3b0c2..1f6f5bbc207 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -1670,7 +1670,8 @@ typedef struct FunctionScanState * * rowcontext per-expression-list context * exprlists array of expression lists being evaluated - * array_len size of array + * exprstatelists array of expression state lists, for SubPlans only + * array_len size of above arrays * curr_idx current array index (0-based) * * Note: ss.ps.ps_ExprContext is used to evaluate any qual or projection @@ -1678,6 +1679,12 @@ typedef struct FunctionScanState * rowcontext, in which to build the executor expression state for each * Values sublist. Resetting this context lets us get rid of expression * state for each row, avoiding major memory leakage over a long values list. + * However, that doesn't work for sublists containing SubPlans, because a + * SubPlan has to be connected up to the outer plan tree to work properly. + * Therefore, for only those sublists containing SubPlans, we do expression + * state construction at executor start, and store those pointers in + * exprstatelists[]. NULL entries in that array correspond to simple + * subexpressions that are handled as described above. * ---------------- */ typedef struct ValuesScanState @@ -1685,6 +1692,7 @@ typedef struct ValuesScanState ScanState ss; /* its first field is NodeTag */ ExprContext *rowcontext; List **exprlists; + List **exprstatelists; int array_len; int curr_idx; } ValuesScanState; |