1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-23 03:21:12 +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:
Tom Lane
2002-01-15 22:14:17 +00:00
parent 685a66cdfe
commit aa00e6134e
7 changed files with 94 additions and 144 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.128 2001/11/05 17:46:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.129 2002/01/15 22:14:17 tgl Exp $
*
*
* INTERFACE ROUTINES
@ -2094,10 +2094,7 @@ heap_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record)
uint32 newlen;
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
{
PageInit(page, BufferGetPageSize(buffer), 0);
PageZero(page);
}
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
{
@ -2262,10 +2259,7 @@ newsame:;
uint32 newlen;
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
{
PageInit(page, BufferGetPageSize(buffer), 0);
PageZero(page);
}
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
{