aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/nodes/execnodes.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 9ac7bc1e697..3d7e7708512 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -1675,7 +1675,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
@@ -1683,6 +1684,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
@@ -1692,6 +1699,8 @@ typedef struct ValuesScanState
List **exprlists;
int array_len;
int curr_idx;
+ /* in back branches, put this at the end to avoid ABI break: */
+ List **exprstatelists;
} ValuesScanState;
/* ----------------