summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-11-15 18:34:14 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2013-11-15 18:34:39 -0500
commit6765a2c96af49dbbd5391804100cae5eedadb94b (patch)
treea204e2c6846ae47fbc6bbc3a460c5396ce223f66 /src
parent0d6a006df6a3d57a3872d982a273e0e71f091dbd (diff)
Fix incorrect loop counts in tidbitmap.c.
A couple of places that should have been iterating over WORDS_PER_CHUNK words were iterating over WORDS_PER_PAGE words instead. This thinko accidentally failed to fail, because (at least on common architectures with default BLCKSZ) WORDS_PER_CHUNK is a bit less than WORDS_PER_PAGE, and the extra words being looked at were always zero so nothing happened. Still, it's a bug waiting to happen if anybody ever fools with the parameters affecting TIDBitmap sizes, and it's a small waste of cycles too. So back-patch to all active branches. Etsuro Fujita
Diffstat (limited to 'src')
-rw-r--r--src/backend/nodes/tidbitmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c
index 9c982db3643..20d792c479a 100644
--- a/src/backend/nodes/tidbitmap.c
+++ b/src/backend/nodes/tidbitmap.c
@@ -362,7 +362,7 @@ tbm_union_page(TIDBitmap *a, const PagetableEntry *bpage)
if (bpage->ischunk)
{
/* Scan b's chunk, mark each indicated page lossy in a */
- for (wordnum = 0; wordnum < WORDS_PER_PAGE; wordnum++)
+ for (wordnum = 0; wordnum < WORDS_PER_CHUNK; wordnum++)
{
bitmapword w = bpage->words[wordnum];
@@ -474,7 +474,7 @@ tbm_intersect_page(TIDBitmap *a, PagetableEntry *apage, const TIDBitmap *b)
/* Scan each bit in chunk, try to clear */
bool candelete = true;
- for (wordnum = 0; wordnum < WORDS_PER_PAGE; wordnum++)
+ for (wordnum = 0; wordnum < WORDS_PER_CHUNK; wordnum++)
{
bitmapword w = apage->words[wordnum];