prune-combine-intersect-bugfix.patch

text/plain

Filename: prune-combine-intersect-bugfix.patch
Type: text/plain
Part: 0
Message: Re: [sqlsmith] Failed assertion on pfree() via perform_pruning_combine_step

Patch

Format: unified
File+
src/backend/partitioning/partprune.c 2 1
diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c
index 417e1fee81..0f0080928a 100644
--- a/src/backend/partitioning/partprune.c
+++ b/src/backend/partitioning/partprune.c
@@ -2923,7 +2923,8 @@ perform_pruning_combine_step(PartitionPruneContext *context,
 				if (firststep)
 				{
 					/* Copy step's result the first time. */
-					result->bound_offsets = step_result->bound_offsets;
+					result->bound_offsets =
+										bms_copy(step_result->bound_offsets);
 					result->scan_null = step_result->scan_null;
 					result->scan_default = step_result->scan_default;
 					firststep = false;