mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Add more sanity-checking to PageAddItem and PageIndexTupleDelete,
to prevent spreading of corruption when page header pointers are bad. Merge PageZero into PageInit, since it was never used separately, and remove separate memset calls used at most other PageInit call points. Remove IndexPageCleanup, which wasn't used at all.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.33 2001/10/25 05:49:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.34 2002/01/15 22:14:16 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Postgres hash pages look like ordinary relation pages. The opaque
|
||||
@@ -301,17 +301,7 @@ _hash_chgbufaccess(Relation rel,
|
||||
void
|
||||
_hash_pageinit(Page page, Size size)
|
||||
{
|
||||
Assert(((PageHeader) page)->pd_lower == 0);
|
||||
Assert(((PageHeader) page)->pd_upper == 0);
|
||||
Assert(((PageHeader) page)->pd_special == 0);
|
||||
|
||||
/*
|
||||
* Cargo-cult programming -- don't really need this to be zero, but
|
||||
* creating new pages is an infrequent occurrence and it makes me feel
|
||||
* good when I know they're empty.
|
||||
*/
|
||||
MemSet(page, 0, size);
|
||||
|
||||
Assert(PageIsNew(page));
|
||||
PageInit(page, size, sizeof(HashPageOpaqueData));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user