mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
Add defenses to btree and hash index AMs to do simple sanity checks
on every index page they read; in particular to catch the case of an all-zero page, which PageHeaderIsValid allows to pass. It turns out hash already had this idea, but it was just Assert()ing things rather than doing a straight error check, and the Asserts were partially redundant with PageHeaderIsValid anyway. Per recent failure example from Jim Nasby. (gist still needs the same treatment.)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.127 2005/10/15 02:49:09 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.128 2005/11/06 19:29:00 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -672,7 +672,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
|
||||
rightpage = BufferGetPage(rbuf);
|
||||
|
||||
_bt_pageinit(leftpage, BufferGetPageSize(buf));
|
||||
_bt_pageinit(rightpage, BufferGetPageSize(rbuf));
|
||||
/* rightpage was already initialized by _bt_getbuf */
|
||||
|
||||
/* init btree private data */
|
||||
oopaque = (BTPageOpaque) PageGetSpecialPointer(origpage);
|
||||
|
||||
Reference in New Issue
Block a user