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

Commitf1f21b2

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 parent97e1ec4 commitf1f21b2

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
@@ -361,7 +361,7 @@ tbm_union_page(TIDBitmap *a, const PagetableEntry *bpage)
361361
if (bpage->ischunk)
362362
{
363363
/* Scan b's chunk, mark each indicated page lossy in a */
364-
for (wordnum=0;wordnum<WORDS_PER_PAGE;wordnum++)
364+
for (wordnum=0;wordnum<WORDS_PER_CHUNK;wordnum++)
365365
{
366366
bitmapwordw=bpage->words[wordnum];
367367

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp