Commit 20ef8717 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

Fix 6.X vacuum bug in shrinking code.

parent 48a61651
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.61 1998/02/03 21:57:27 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.62 1998/02/25 23:40:32 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1083,23 +1083,19 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel, ...@@ -1083,23 +1083,19 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
/* /*
* If no one tuple can't be added to this page - * If no one tuple can't be added to this page -
* remove page from Fvpl. - vadim 11/27/96 * remove page from Fvpl. - vadim 11/27/96
*
* But we can't remove last page - this is our
* "show-stopper" !!! - vadim 02/25/98
*/ */
if (!vc_enough_space(ToVpd, vacrelstats->min_tlen)) if (ToVpd != Fvplast &&
!vc_enough_space(ToVpd, vacrelstats->min_tlen))
{ {
if (ToVpd != Fvplast) Assert(Fnpages > ToVpI + 1);
{ memmove(Fvpl->vpl_pgdesc + ToVpI,
Assert(Fnpages > ToVpI + 1); Fvpl->vpl_pgdesc + ToVpI + 1,
memmove(Fvpl->vpl_pgdesc + ToVpI, sizeof(VPageDescr *) * (Fnpages - ToVpI - 1));
Fvpl->vpl_pgdesc + ToVpI + 1,
sizeof(VPageDescr *) * (Fnpages - ToVpI - 1));
}
Assert(Fnpages >= 1);
Fnpages--; Fnpages--;
if (Fnpages == 0) Assert (Fvplast == Fvpl->vpl_pgdesc[Fnpages - 1]);
break;
/* get prev reapped page from Fvpl */
Fvplast = Fvpl->vpl_pgdesc[Fnpages - 1];
Fblklast = Fvplast->vpd_blkno;
} }
} }
for (i = 0; i < Fnpages; i++) for (i = 0; i < Fnpages; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment