Fix integer-to-bit-string conversions to handle the first fractional byte

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 2714d78dacb920888b5a84720f3227672b2a05db
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-12-12T19:25:10Z
Releases: 8.0.24
Fix integer-to-bit-string conversions to handle the first fractional byte
correctly when the output bit width is wider than the given integer by
something other than a multiple of 8 bits.

This has been wrong since I first wrote that code for 8.0 :-(.  Kudos to
Roman Kononov for being the first to notice, though I didn't use his
patch.  Per bug #5237.

Files

PathChange+/−
src/backend/utils/adt/varbit.c modified +13 −3