19056_fix.patch

application/octet-stream

Filename: 19056_fix.patch
Type: application/octet-stream
Part: 0
Message: Re: BUG #19056: ExecInitPartitionExecPruning segfault due to NULL es_part_prune_infos

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/executor/execMain.c 9 0
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index ff12e2e1364..831c55ce787 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -3084,6 +3084,15 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree)
 	 */
 	rcestate->es_unpruned_relids = parentestate->es_unpruned_relids;
 
+	/*
+	 * Also make the PartitionPruneInfo and the results of pruning available.
+	 * These need to match exactly so that we initialize all the same Append
+	 * and MergeAppend subplans as the parent did.
+	 */
+	rcestate->es_part_prune_infos = parentestate->es_part_prune_infos;
+	rcestate->es_part_prune_states = parentestate->es_part_prune_states;
+	rcestate->es_part_prune_results = parentestate->es_part_prune_results;
+
 	/*
 	 * Initialize private state information for each SubPlan.  We must do this
 	 * before running ExecInitNode on the main query tree, since