From: Robert Haas Date: Sun, 10 Jun 2012 12:30:36 +0000 (-0400) Subject: Variable renaming, plus fix one failure to set F_ROOT on root buffer. X-Git-Url: http://git.postgresql.org/gitweb/static/developers.postgresql.org?a=commitdiff_plain;h=dc0fb9a569f0d863bc3412af29434fa6ce9a57a4;p=users%2Frhaas%2Fpostgres.git Variable renaming, plus fix one failure to set F_ROOT on root buffer. --- diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index fef1f22e55..9d68afb64f 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -117,8 +117,8 @@ gistbuild(PG_FUNCTION_ARGS) IndexBuildResult *result; double reltuples; GISTBuildState buildstate; - Buffer buffer; - Page page; + Buffer rootbuffer; + Page rootpage; MemoryContext oldcxt = CurrentMemoryContext; int fillfactor; @@ -179,14 +179,14 @@ gistbuild(PG_FUNCTION_ARGS) buildstate.giststate->tempCxt = createTempGistContext(); /* initialize the root page */ - buffer = gistNewBuffer(index); - page = BufferGetPage(buffer); + rootbuffer = gistNewBuffer(index); + rootpage = BufferGetPage(rootbuffer); START_CRIT_SECTION(); - GISTInitBuffer(buffer, F_LEAF); + GISTInitBuffer(rootbuffer, F_LEAF | F_ROOT); - MarkBufferDirty(buffer); + MarkBufferDirty(rootbuffer); if (RelationNeedsWAL(index)) { @@ -195,7 +195,7 @@ gistbuild(PG_FUNCTION_ARGS) gistxlogCreateIndex xlrec; xlrec.node = index->rd_node; - xlrec.blkno = BufferGetBlockNumber(buffer); + xlrec.blkno = BufferGetBlockNumber(rootbuffer); rdata.data = (char *) &xlrec; rdata.len = sizeof(RelFileNode); @@ -203,13 +203,13 @@ gistbuild(PG_FUNCTION_ARGS) rdata.next = NULL; recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_CREATE_INDEX, &rdata); - PageSetLSN(page, recptr); - PageSetTLI(page, ThisTimeLineID); + PageSetLSN(rootpage, recptr); + PageSetTLI(rootpage, ThisTimeLineID); } else - PageSetLSN(page, GetXLogRecPtrForTemp()); + PageSetLSN(rootpage, GetXLogRecPtrForTemp()); - UnlockReleaseBuffer(buffer); + UnlockReleaseBuffer(rootbuffer); END_CRIT_SECTION();