Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32b3284

Browse files
committed
Fix incorrect loop counts in tidbitmap.c.
A couple of places that should have been iterating over WORDS_PER_CHUNKwords were iterating over WORDS_PER_PAGE words instead. This thinkoaccidentally failed to fail, because (at least on common architectureswith 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 theparameters affecting TIDBitmap sizes, and it's a small waste of cyclestoo. So back-patch to all active branches.Etsuro Fujita
1 parent1821ef1 commit32b3284

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/nodes/tidbitmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ tbm_union_page(TIDBitmap *a, const PagetableEntry *bpage)
362362
if (bpage->ischunk)
363363
{
364364
/* Scan b's chunk, mark each indicated page lossy in a */
365-
for (wordnum=0;wordnum<WORDS_PER_PAGE;wordnum++)
365+
for (wordnum=0;wordnum<WORDS_PER_CHUNK;wordnum++)
366366
{
367367
bitmapwordw=bpage->words[wordnum];
368368

@@ -474,7 +474,7 @@ tbm_intersect_page(TIDBitmap *a, PagetableEntry *apage, const TIDBitmap *b)
474474
/* Scan each bit in chunk, try to clear */
475475
boolcandelete= true;
476476

477-
for (wordnum=0;wordnum<WORDS_PER_PAGE;wordnum++)
477+
for (wordnum=0;wordnum<WORDS_PER_CHUNK;wordnum++)
478478
{
479479
bitmapwordw=apage->words[wordnum];
480480

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp