1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

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.
This commit is contained in:
Tom Lane
2013-08-30 19:15:21 -04:00
parent 9381cb5229
commit 8e2b71d2d0
3 changed files with 19 additions and 3 deletions

View File

@ -297,5 +297,6 @@ ExecReScanMergeAppend(MergeAppendState *node)
if (subnode->chgParam == NULL)
ExecReScan(subnode);
}
binaryheap_reset(node->ms_heap);
node->ms_initialized = false;
}