summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim B. Mikheev1996-11-28 04:37:38 +0000
committerVadim B. Mikheev1996-11-28 04:37:38 +0000
commitc7cba5780f43a1db099b9a9d261678403b5a3b92 (patch)
treeba3a88d7549bb2749eb22285e1a509423067304a
parentf0e7004d29e9809a5f36b2b54f160ca4c94f3c90 (diff)
Fix for "might be used uninitialized" warnings.
-rw-r--r--src/backend/commands/vacuum.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 06140f7c277..4d2c96094a6 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.9 1996/11/27 07:27:20 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.10 1996/11/28 04:37:38 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -245,7 +245,7 @@ _vc_getrels(Portal p, NameData *VacRelP)
}
portalmem = PortalGetVariableMemory(p);
- vrl = (VRelList) NULL;
+ vrl = cur = (VRelList) NULL;
pgclass = heap_openr(RelationRelationName);
pgcdesc = RelationGetTupleDescriptor(pgclass);
@@ -511,7 +511,6 @@ _vc_scanheap (VRelList curvrl, Relation onerel,
page = BufferGetPage(buf);
vpc->vpd_blkno = blkno;
vpc->vpd_noff = 0;
- vpc->vpd_noff = 0;
if (PageIsNew(page)) {
elog (NOTICE, "Rel %.*s: Uninitialized page %u - fixing",
@@ -734,19 +733,19 @@ _vc_rpfheap (VRelList curvrl, Relation onerel,
{
TransactionId myXID;
CommandId myCID;
- AbsoluteTime myCTM;
+ AbsoluteTime myCTM = 0;
Buffer buf, ToBuf;
int nblocks, blkno;
- Page page, ToPage;
- OffsetNumber offnum, maxoff, newoff, moff;
+ Page page, ToPage = NULL;
+ OffsetNumber offnum = 0, maxoff = 0, newoff, moff;
ItemId itemid, newitemid;
HeapTuple htup, newtup;
- TupleDesc tupdesc;
- Datum *idatum;
- char *inulls;
+ TupleDesc tupdesc = NULL;
+ Datum *idatum = NULL;
+ char *inulls = NULL;
InsertIndexResult iresult;
VPageListData Nvpl;
- VPageDescr ToVpd, Fvplast, Vvplast, vpc, *vpp;
+ VPageDescr ToVpd = NULL, Fvplast, Vvplast, vpc, *vpp;
IndDesc *Idesc, *idcur;
int Fblklast, Vblklast, i;
Size tlen;
@@ -803,7 +802,7 @@ _vc_rpfheap (VRelList curvrl, Relation onerel,
nmoved = 0;
vpc = (VPageDescr) palloc (sizeof(VPageDescrData) + MaxOffsetNumber*sizeof(OffsetNumber));
- vpc->vpd_nusd = 0;
+ vpc->vpd_nusd = vpc->vpd_noff = 0;
nblocks = curvrl->vrl_npages;
for (blkno = nblocks - Vvpl->vpl_nemend - 1; ; blkno--)
@@ -819,6 +818,7 @@ _vc_rpfheap (VRelList curvrl, Relation onerel,
isempty = PageIsEmpty(page);
+ dowrite = false;
if ( blkno == Vblklast ) /* it's reapped page */
{
if ( Vvplast->vpd_noff > 0 ) /* there are dead tuples */
@@ -851,7 +851,6 @@ _vc_rpfheap (VRelList curvrl, Relation onerel,
else
{
Assert ( ! isempty );
- dowrite = false;
}
vpc->vpd_blkno = blkno;