]> granicus.if.org Git - postgresql/commit
Add missed bms_copy() in perform_pruning_combine_step
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 9 Apr 2018 13:54:28 +0000 (10:54 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 9 Apr 2018 13:54:28 +0000 (10:54 -0300)
commit7ba6ee815dc90d4fab7226d343bf72aa28c9aa5c
tree4843b76976bbe3386849c890236efbcc448ac3ad
parent2c19ea863a27303f462485c4046a850864e638b8
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
src/backend/partitioning/partprune.c