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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy