postgres.git / summary / log / commit / refs

commit    39aafc88c4b4ac281df8b2c2b8be72d4e4d99e9f
Author:   Alexander Korotkov <akorotkov@postgresql.org>
Date:     Sat Jun 20 14:34:51 2020 +0000
First released in: 14.0, 11.9, 12.4, 13.0

    Fix masking of SP-GiST pages during xlog consistency check
    
    spg_mask() didn't take into account that pd_lower equal to SizeOfPageHeaderData
    is still valid value.  This commit fixes that.  Backpatch to 11, where
    spg_mask() pg_lower check was introduced.
    
    Reported-by: Michael Paquier
    Discussion: https://postgr.es/m/20200615131405.GM52676%40paquier.xyz
    Backpatch-through: 11


src/backend/access/spgist/spgxlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/spgist/spgxlog.c b/src/backend/access/spgist/spgxlog.c index 7be2291d07e..999d0ca15d5 100644 --- a/src/backend/access/spgist/spgxlog.c +++ b/src/backend/access/spgist/spgxlog.c @@ -1008,6 +1008,6 @@ spg_mask(char *pagedata, BlockNumber blkno) * Mask the unused space, but only if the page's pd_lower appears to have * been set correctly. */ - if (pagehdr->pd_lower > SizeOfPageHeaderData) + if (pagehdr->pd_lower >= SizeOfPageHeaderData) mask_unused_space(page); } [parent: e6c6f427e356]