]> 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)
commit8b77f783b7584e8cbcf0aa42c7f176f7f23937ae
tree061782d981e65447e9a137409b12e07a844e36dd
parent54d641da0640bf2f1fb2adb346c76638911b5df3
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