Обсуждение: bug in pageinspect contrib modul
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
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
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