]> granicus.if.org Git - postgresql/commit
Reset the binary heap in MergeAppend rescans.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Aug 2013 23:15:21 +0000 (19:15 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Aug 2013 23:15:21 +0000 (19:15 -0400)
commit8e2b71d2d0381f7acc820a2400580a1e3a6add8c
tree2e419f5090c23820a43397c391627150bf7fae41
parent9381cb5229da1f3556909585b38ada347d798161
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/backend/executor/nodeMergeAppend.c
src/backend/lib/binaryheap.c
src/include/lib/binaryheap.h