From 8e2b71d2d0381f7acc820a2400580a1e3a6add8c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 30 Aug 2013 19:15:21 -0400 Subject: Reset the binary heap in MergeAppend rescans. Failing to do so can cause queries to return wrong data, error out or crash. This requires adding a new binaryheap_reset() method to binaryheap.c, but that probably should have been there anyway. Per bug #8410 from Terje Elde. Diagnosis and patch by Andres Freund. --- src/include/lib/binaryheap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/lib/binaryheap.h') diff --git a/src/include/lib/binaryheap.h b/src/include/lib/binaryheap.h index 1e99e72e515..85cafe4d4dd 100644 --- a/src/include/lib/binaryheap.h +++ b/src/include/lib/binaryheap.h @@ -40,6 +40,7 @@ typedef struct binaryheap extern binaryheap *binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg); +extern void binaryheap_reset(binaryheap *heap); extern void binaryheap_free(binaryheap *heap); extern void binaryheap_add_unordered(binaryheap *heap, Datum d); extern void binaryheap_build(binaryheap *heap); -- cgit v1.2.3