bms_prev_member won't work correctly if bitmapword is 64-bits - Mailing list pgsql-hackers

From David Rowley
Subject bms_prev_member won't work correctly if bitmapword is 64-bits
Date
Msg-id CAKJS1f_EFJRUM_8ptUpoxE7Wbi-NOg3Pd2kbqiWXcn-XHmsVrA@mail.gmail.com
Whole thread Raw
Responses Re: bms_prev_member won't work correctly if bitmapword is 64-bits  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
bms_prev_member mistakenly has a hardcoded 24 in the function. This
should really be BITS_PER_BITMAPWORD - 8 so that it is properly set to
56 if someone compiles with 64-bit bitmapwords.

The attached fixes this and also adds a test to exercise the function
a bit. [1] indicates there's currently no coverage of this function at
all.

[1] https://coverage.postgresql.org/src/backend/nodes/bitmapset.c.gcov.html

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Corrupted btree index on HEAD because of covering indexes
Next
From: Michael Paquier
Date:
Subject: BGWORKER_BYPASS_ALLOWCONN used nowhere (infra part of on-linechecksum switcher)