pgsql: Put back initialization of 'sslmode', to silence Coverity

2024-04-14 Thread Heikki Linnakangas
Put back initialization of 'sslmode', to silence Coverity Coverity pointed out that the function checks for conn->sslmode != NULL, which implies that it might be NULL, but later we access it without a NULL-check anyway. It doesn't know that it is in fact always initialized earlier, in

pgsql: Fix unnecessary padding in incremental backups

2024-04-14 Thread Tomas Vondra
Fix unnecessary padding in incremental backups Commit 10e3226ba13d added padding to incremental backups to ensure the block data is properly aligned. The code in sendFile() however failed to consider that the header may be a multiple of BLCKSZ and thus already aligned, adding a full BLCKSZ of

pgsql: Add regression test for BRIN parallel builds

2024-04-14 Thread Tomas Vondra
Add regression test for BRIN parallel builds Adds a regression test for parallel CREATE INDEX for BRIN indexes, to improve coverage for BRIN code, particularly code to allow parallel index builds introduced by b43757171470. The test is added to pageinspect, as that allows comparing the index to

pgsql: Use the correct PG_DETOAST_DATUM macro in BRIN

2024-04-14 Thread Tomas Vondra
Use the correct PG_DETOAST_DATUM macro in BRIN Commit 6bcda4a721 replaced PG_DETOAST_DATUM with PG_DETOAST_DATUM_PACKED in two BRIN output functions, for minmax-multi and bloom opclasses. But this is incorrect - the code is accessing the data through structs that already include a 4B header, so

pgsql: Use the correct PG_DETOAST_DATUM macro in BRIN

2024-04-14 Thread Tomas Vondra
Use the correct PG_DETOAST_DATUM macro in BRIN Commit 6bcda4a721 replaced PG_DETOAST_DATUM with PG_DETOAST_DATUM_PACKED in two BRIN output functions, for minmax-multi and bloom opclasses. But this is incorrect - the code is accessing the data through structs that already include a 4B header, so

pgsql: Update nbits_set in brin_bloom_union

2024-04-14 Thread Tomas Vondra
Update nbits_set in brin_bloom_union Properly update the number of bits set in the bitmap after merging the filters in brin_bloom_union. This is mostly harmless, as the counter is used only in the output function, which means pageinspect may show incorrect information about the BRIN summary. The

pgsql: Update nbits_set in brin_bloom_union

2024-04-14 Thread Tomas Vondra
Update nbits_set in brin_bloom_union Properly update the number of bits set in the bitmap after merging the filters in brin_bloom_union. This is mostly harmless, as the counter is used only in the output function, which means pageinspect may show incorrect information about the BRIN summary. The

pgsql: Update nbits_set in brin_bloom_union

2024-04-14 Thread Tomas Vondra
Update nbits_set in brin_bloom_union Properly update the number of bits set in the bitmap after merging the filters in brin_bloom_union. This is mostly harmless, as the counter is used only in the output function, which means pageinspect may show incorrect information about the BRIN summary. The

pgsql: Update nbits_set in brin_bloom_union

2024-04-14 Thread Tomas Vondra
Update nbits_set in brin_bloom_union Properly update the number of bits set in the bitmap after merging the filters in brin_bloom_union. This is mostly harmless, as the counter is used only in the output function, which means pageinspect may show incorrect information about the BRIN summary. The