Re: page macros cleanup - Mailing list pgsql-patches

From Heikki Linnakangas
Subject Re: page macros cleanup
Date
Msg-id 486CDC83.7060609@enterprisedb.com
Whole thread Raw
In response to page macros cleanup  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: page macros cleanup
List pgsql-patches
Just one quick note:

Zdenek Kotala wrote:
> *** pgsql.orig.da8c485e0e2a/src/backend/access/gist/gistutil.c    pá črn 13 18:00:35 2008
> --- pgsql.orig/src/backend/access/gist/gistutil.c    pá črn 13 18:00:35 2008
> ***************
> *** 592,598 ****
>       /*
>        * Additionally check that the special area looks sane.
>        */
> !     if (((PageHeader) (page))->pd_special !=
>           (BLCKSZ - MAXALIGN(sizeof(GISTPageOpaqueData))))
>           ereport(ERROR,
>                   (errcode(ERRCODE_INDEX_CORRUPTED),
> --- 592,598 ----
>       /*
>        * Additionally check that the special area looks sane.
>        */
> !     if ( PageGetSpecialPointer(page) - page !=
>           (BLCKSZ - MAXALIGN(sizeof(GISTPageOpaqueData))))
>           ereport(ERROR,
>                   (errcode(ERRCODE_INDEX_CORRUPTED),

Should probably use PageGetSpecialSize here. Much simpler, and doesn't
assume that the special area is always at the end of page (not that I
see us changing that anytime soon).

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: EXPLAIN progress info
Next
From: Tom Lane
Date:
Subject: Re: pg_dump lock timeout