Fix PageGetExactFreeSpace() so that it actually behaves sensibly

if pd_lower > pd_upper, rather than merely claiming to.  This would
only matter if the page header were corrupt, which shouldn't occur,
but ...
This commit is contained in:
Tom Lane 2008-02-10 20:39:08 +00:00
parent 0028b22d68
commit 082aca9ec2
1 changed files with 4 additions and 1 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/page/bufpage.c,v 1.77 2008/01/01 19:45:52 momjian Exp $
* $PostgreSQL: pgsql/src/backend/storage/page/bufpage.c,v 1.78 2008/02/10 20:39:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -489,6 +489,9 @@ PageGetExactFreeSpace(Page page)
space = (int) ((PageHeader) page)->pd_upper -
(int) ((PageHeader) page)->pd_lower;
if (space < 0)
return 0;
return (Size) space;
}