Re: bug in pageinspect contrib modul

Lists: Postg스포츠 토토 사이트SQL : Postg스포츠 토토 사이트SQL 메일 링리스트 : 2008-10-23 이후 PGSQL-BUGS 09:57
From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug in pageinspect contrib modul
Date: 2008-10-23 09:38:50
Message-ID: 4900462A.6080001@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

The following code is in btreefuncs.c function GetBTPageStatistics:

stat->max_avail = BLCKSZ - (BLCKSZ - phdr->pd_special + SizeOfPageHeaderData);

I think it should be:

stat->max_avail = BLCKSZ - (phdr->pd_special + SizeOfPageHeaderData);

Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: bug in pageinspect contrib modul
Date: 2008-10-23 09:57:27
Message-ID: 49004A87.6070406@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg스포츠 토토 사이트SQL : Postg스포츠 토토 사이트SQL 메일 링리스트 : 2008-10-23 이후 PGSQL-BUGS 09:57

Zdenek Kotala wrote:
> The following code is in btreefuncs.c function GetBTPageStatistics:
>
> stat->max_avail = BLCKSZ - (BLCKSZ - phdr->pd_special +
> SizeOfPageHeaderData);
>
> I think it should be:
>
> stat->max_avail = BLCKSZ - (phdr->pd_special + SizeOfPageHeaderData);

Umm, I don't think so. pd_special is the offset to the start of the
special area, so (BLCKSZ - pd_special) is the size of the special area.

However, that max_avail field actually looks like dead code, anyway.

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


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: bug in pageinspect contrib modul
Date: 2008-10-23 10:06:08
Message-ID: 49004C90.3080507@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Heikki Linnakangas napsal(a):
> Zdenek Kotala wrote:
>> The following code is in btreefuncs.c function GetBTPageStatistics:
>>
>> stat->max_avail = BLCKSZ - (BLCKSZ - phdr->pd_special +
>> SizeOfPageHeaderData);
>>
>> I think it should be:
>>
>> stat->max_avail = BLCKSZ - (phdr->pd_special + SizeOfPageHeaderData);
>
> Umm, I don't think so. pd_special is the offset to the start of the
> special area, so (BLCKSZ - pd_special) is the size of the special area.
>
> However, that max_avail field actually looks like dead code, anyway.

Yeah, you are right. I forgot that pd_special does not contain size but offset.

Thanks Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql