diff options
author | Alvaro Herrera | 2017-11-03 19:36:32 +0000 |
---|---|---|
committer | Alvaro Herrera | 2017-11-03 19:45:36 +0000 |
commit | 1b890562b8d1b44bd3ef948aeeb58dd59abd04b7 (patch) | |
tree | 012a6aab376f3eac6a3a395cb3608626b61136d8 | |
parent | 49df45acd8d40ee172c2f5491485de997c5f1020 (diff) |
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.
-rw-r--r-- | src/backend/access/brin/brin.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index 8636620f647..cafc8fe7bea 100644 --- a/src/backend/access/brin/brin.c +++ b/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); |