Thanks for looking. On Tue, 14 Apr 2026 at 20:46, Chao Li <[email protected]> wrote: > + if (((uint64) new_nwords - 1) * BITS_PER_BITMAPWORD + > high_bit + offset_bits > PG_INT32_MAX) > + elog(ERROR, "bitmapset overflow");
> This overflow check seems wrong. Because when high_bit + offset_bits > > BITS_PER_BITMAPWORD, new_nwords has been increased by 1, so there high_bit + > offset_bits are double counted. Your idea of checking the old highest member plus the offset seems a more robust method, so I've adjusted the patch to use that. David
v2-0001-Introduce-bms_offset_members-function.patch
Description: Binary data
