]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix masking of SP-GiST pages during xlog consistency check
authorAlexander Korotkov <akorotkov@postgresql.org>
Sat, 20 Jun 2020 14:34:51 +0000 (17:34 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sat, 20 Jun 2020 14:35:59 +0000 (17:35 +0300)
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

index 9e2bd3f811912fe14cf6903c5bf50450c9324dfa..314f6eaa81f29b33d98483d0a3af4c6be00db098 100644 (file)
@@ -1043,6 +1043,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);
 }