pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix failure to zero-pad the result of bitshiftright().

2019-09-22 Thread Tom Lane
Fix failure to zero-pad the result of bitshiftright(). If the bitstring length is not a multiple of 8, we'd shift the rightmost bits into the pad space, which must be zeroes --- bit_cmp, for one, depends on that. This'd lead to the result failing to compare equal to what it should compare equal t

pgsql: Fix typo in tts_virtual_copyslot.

2019-09-22 Thread Tom Lane
Fix typo in tts_virtual_copyslot. The code used the destination slot's natts where it intended to use the source slot's natts. Adding an Assert shows that there is no case in "make check-world" where these counts are different, so maybe this is a harmless bug, but it's still a bug. Takayuki Tsun

pgsql: Fix typo in tts_virtual_copyslot.

2019-09-22 Thread Tom Lane
Fix typo in tts_virtual_copyslot. The code used the destination slot's natts where it intended to use the source slot's natts. Adding an Assert shows that there is no case in "make check-world" where these counts are different, so maybe this is a harmless bug, but it's still a bug. Takayuki Tsun

pgsql: Make some efficiency improvements in LISTEN/NOTIFY.

2019-09-22 Thread Tom Lane
Make some efficiency improvements in LISTEN/NOTIFY. Move the responsibility for advancing the NOTIFY queue tail pointer from the listener(s) to the notification sender, and only have the sender do it once every few queue pages, rather than after every batch of notifications as at present. This re