]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix incorrect loop counts in tidbitmap.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 15 Nov 2013 23:34:14 +0000 (18:34 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 15 Nov 2013 23:34:34 +0000 (18:34 -0500)
commit32b32845e05c4dfe0862c89d12e0cacef4e018bb
tree10b8d1c03f149d6934d091aaad7a23c8828b41f3
parent1821ef15bd063fdfd0073dff7b18fa7f0d639554
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
src/backend/nodes/tidbitmap.c