Fix thinkos in BRIN summarization

The previous commit contained a thinko that made a single-range
summarization request process from there to end of table.  Fix by
setting the correct end range point.  Per buildfarm.
pull/31/head^2
Alvaro Herrera 8 years ago
parent 49df45acd8
commit 1b890562b8
  1. 5
      src/backend/access/brin/brin.c

@ -1292,8 +1292,11 @@ brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange,
if (pageRange == BRIN_ALL_BLOCKRANGES)
startBlk = 0;
else
{
startBlk = (pageRange / pagesPerRange) * pagesPerRange;
if (startBlk >= heapNumBlocks)
heapNumBlocks = Min(heapNumBlocks, startBlk + pagesPerRange);
}
if (startBlk > heapNumBlocks)
{
/* Nothing to do if start point is beyond end of table */
brinRevmapTerminate(revmap);

Loading…
Cancel
Save