Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a88a18b

Browse files
committed
Assert only valid flag bits are passed to visibilitymap_set()
If visibilitymap_set() is called with flags containing a higher bit than VISIBILITYMAP_ALL_FROZEN, the state of neighboring pages is affected. While there was an assertion that *some* valid bits were set, it did not check that *only* valid bits were. Change that. Discussion: https://postgr.es/m/20230331043300.gux3s5wzrapqi4oe@awork3.anarazel.de
1 parent 14f98e0 commit a88a18b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/heap/visibilitymap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
259259

260260
Assert(InRecovery || XLogRecPtrIsInvalid(recptr));
261261
Assert(InRecovery || PageIsAllVisible((Page) BufferGetPage(heapBuf)));
262+
Assert((flags & VISIBILITYMAP_VALID_BITS) == flags);
262263

263264
/* Must never set all_frozen bit without also setting all_visible bit */
264-
Assert(flags & VISIBILITYMAP_VALID_BITS);
265265
Assert(flags != VISIBILITYMAP_ALL_FROZEN);
266266

267267
/* Check that we have the right heap page pinned, if present */

0 commit comments

Comments
 (0)