Skip to content

Commit 7ba6ee8

Browse files
committed
Add missed bms_copy() in perform_pruning_combine_step
We were initializing a BMS to merely reference an existing one, which would cause a double-free (and a crash) when the recursive algorithm tried to intersect it with an empty one. Fix it by creating a copy at initialization time. Reported-by: sqlsmith (by way of Andreas Seltenreich) Author: Amit Langote Discussion: https://postgr.es/m/87in923lyw.fsf@ansel.ydns.eu
1 parent 2c19ea8 commit 7ba6ee8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/partitioning/partprune.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2923,7 +2923,8 @@ perform_pruning_combine_step(PartitionPruneContext *context,
29232923
if (firststep)
29242924
{
29252925
/* Copy step's result the first time. */
2926-
result->bound_offsets = step_result->bound_offsets;
2926+
result->bound_offsets =
2927+
bms_copy(step_result->bound_offsets);
29272928
result->scan_null = step_result->scan_null;
29282929
result->scan_default = step_result->scan_default;
29292930
firststep = false;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy