pgsql: Add some additional tests for row filters in logical replication

2022-03-03 Thread Amit Kapila
Add some additional tests for row filters in logical replication. Commit 52e4f0cd47 didn't add tests for pg_dump support, so add a few tests for it. Additionally, verify that catalogs are updated after few ALTER PUBLICATION commands that modify row filters by using \d. Reported-by: Tomas Vondra A

pgsql: Tighten overflow checks in tidin().

2022-03-03 Thread Tom Lane
Tighten overflow checks in tidin(). This code seems to have been written on the assumption that "unsigned long" is 32 bits; or at any rate it ignored the possibility of conversion overflow. Rewrite, borrowing some logic from oidin(). Discussion: https://postgr.es/m/[email protected].

Re: pgsql: Fix catalog data of pg_stop_backup(), labelled v2

2022-03-03 Thread Michael Paquier
On Thu, Mar 03, 2022 at 10:09:40AM -0500, Tom Lane wrote: > func.sgml also needs to be fixed, as it says the result > is "setof record". Thanks, fixed. -- Michael signature.asc Description: PGP signature

pgsql: doc: Fix description of pg_stop_backup()

2022-03-03 Thread Michael Paquier
doc: Fix description of pg_stop_backup() The function was still documented as returning a set of records, something not true as of 62ce0c7. Reported-by: Tom Lane Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/c

pgsql: Remove some pointless code in block.h.

2022-03-03 Thread Tom Lane
Remove some pointless code in block.h. There's no visible point in casting the result of a comparison to bool, because it already is that, at least on C99 compilers. I see no point in these assertions that a pointer we're about to dereference isn't null, either. If it is, the resulting SIGSEGV w

pgsql: Fix bogus casting in BlockIdGetBlockNumber().

2022-03-03 Thread Tom Lane
Fix bogus casting in BlockIdGetBlockNumber(). This macro cast the result to BlockNumber after shifting, not before, which is the wrong thing. Per the C spec, the uint16 fields would promote to int not unsigned int, so that (for 32-bit int) the shift potentially shifts a nonzero bit into the sign

pgsql: Fix bogus casting in BlockIdGetBlockNumber().

2022-03-03 Thread Tom Lane
Fix bogus casting in BlockIdGetBlockNumber(). This macro cast the result to BlockNumber after shifting, not before, which is the wrong thing. Per the C spec, the uint16 fields would promote to int not unsigned int, so that (for 32-bit int) the shift potentially shifts a nonzero bit into the sign

pgsql: Fix bogus casting in BlockIdGetBlockNumber().

2022-03-03 Thread Tom Lane
Fix bogus casting in BlockIdGetBlockNumber(). This macro cast the result to BlockNumber after shifting, not before, which is the wrong thing. Per the C spec, the uint16 fields would promote to int not unsigned int, so that (for 32-bit int) the shift potentially shifts a nonzero bit into the sign

pgsql: Fix bogus casting in BlockIdGetBlockNumber().

2022-03-03 Thread Tom Lane
Fix bogus casting in BlockIdGetBlockNumber(). This macro cast the result to BlockNumber after shifting, not before, which is the wrong thing. Per the C spec, the uint16 fields would promote to int not unsigned int, so that (for 32-bit int) the shift potentially shifts a nonzero bit into the sign

pgsql: Fix bogus casting in BlockIdGetBlockNumber().

2022-03-03 Thread Tom Lane
Fix bogus casting in BlockIdGetBlockNumber(). This macro cast the result to BlockNumber after shifting, not before, which is the wrong thing. Per the C spec, the uint16 fields would promote to int not unsigned int, so that (for 32-bit int) the shift potentially shifts a nonzero bit into the sign

pgsql: Fix bogus casting in BlockIdGetBlockNumber().

2022-03-03 Thread Tom Lane
Fix bogus casting in BlockIdGetBlockNumber(). This macro cast the result to BlockNumber after shifting, not before, which is the wrong thing. Per the C spec, the uint16 fields would promote to int not unsigned int, so that (for 32-bit int) the shift potentially shifts a nonzero bit into the sign

pgsql: Clean up assorted failures under clang's -fsanitize=undefined ch

2022-03-03 Thread Tom Lane
Clean up assorted failures under clang's -fsanitize=undefined checks. Most of these are cases where we could call memcpy() or other libc functions with a NULL pointer and a zero count, which is forbidden by POSIX even though every production version of libc allows it. We've fixed such things befor

pgsql: Clean up assorted failures under clang's -fsanitize=undefined ch

2022-03-03 Thread Tom Lane
Clean up assorted failures under clang's -fsanitize=undefined checks. Most of these are cases where we could call memcpy() or other libc functions with a NULL pointer and a zero count, which is forbidden by POSIX even though every production version of libc allows it. We've fixed such things befor

pgsql: Clean up assorted failures under clang's -fsanitize=undefined ch

2022-03-03 Thread Tom Lane
Clean up assorted failures under clang's -fsanitize=undefined checks. Most of these are cases where we could call memcpy() or other libc functions with a NULL pointer and a zero count, which is forbidden by POSIX even though every production version of libc allows it. We've fixed such things befor

pgsql: Clean up assorted failures under clang's -fsanitize=undefined ch

2022-03-03 Thread Tom Lane
Clean up assorted failures under clang's -fsanitize=undefined checks. Most of these are cases where we could call memcpy() or other libc functions with a NULL pointer and a zero count, which is forbidden by POSIX even though every production version of libc allows it. We've fixed such things befor

pgsql: Clean up assorted failures under clang's -fsanitize=undefined ch

2022-03-03 Thread Tom Lane
Clean up assorted failures under clang's -fsanitize=undefined checks. Most of these are cases where we could call memcpy() or other libc functions with a NULL pointer and a zero count, which is forbidden by POSIX even though every production version of libc allows it. We've fixed such things befor

pgsql: Clean up assorted failures under clang's -fsanitize=undefined ch

2022-03-03 Thread Tom Lane
Clean up assorted failures under clang's -fsanitize=undefined checks. Most of these are cases where we could call memcpy() or other libc functions with a NULL pointer and a zero count, which is forbidden by POSIX even though every production version of libc allows it. We've fixed such things befor

Re: pgsql: Fix catalog data of pg_stop_backup(), labelled v2

2022-03-03 Thread Tom Lane
Michael Paquier writes: > Fix catalog data of pg_stop_backup(), labelled v2 func.sgml also needs to be fixed, as it says the result is "setof record". regards, tom lane