]> granicus.if.org Git - postgresql/commit
Fix bitshiftright()'s zero-padding some more.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 4 Oct 2019 14:34:21 +0000 (10:34 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 4 Oct 2019 14:34:21 +0000 (10:34 -0400)
commit9faa9794f885bd27bbb2c1f0a287d5efa8437ade
treed9033b511068b8e6b76482bcec2f199d8852621c
parent226551e7c385de804fceb0118d1b79de9279c260
Fix bitshiftright()'s zero-padding some more.

Commit 5ac0d9360 failed to entirely fix bitshiftright's habit of
leaving one-bits in the pad space that should be all zeroes,
because in a moment of sheer brain fade I'd concluded that only
the code path used for not-a-multiple-of-8 shift distances needed
to be fixed.  Of course, a multiple-of-8 shift distance can also
cause the problem, so we need to forcibly zero the extra bits
in both cases.

Per bug #16037 from Alexander Lakhin.  As before, back-patch to all
supported branches.

Discussion: https://postgr.es/m/16037-1d1ebca564db54f4@postgresql.org
src/backend/utils/adt/varbit.c
src/test/regress/expected/bit.out
src/test/regress/sql/bit.sql