From: Markus Wanner <markus@bluegap.ch>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: BlockNumber initialized to InvalidBuffer?
Date: Tue, 10 Jul 2012 15:07:56 +0200
Message-ID: <4FFC292C.20703@bluegap.ch> (raw)
Hackers,
I stumbled across an initialization of a BlockNumber with InvalidBuffer,
which seems strange to me, as the values for "invalid" of the two types
are different, see attached patch.
In case the 'stack' argument passed to that function is not NULL, the
variable in question gets overridden immediately, in which case it
certainly doesn't matter. I don't know nor did I check whether or not it
can ever be NULL. So this might not be a real issue at all.
Regards
Markus Wanner
Attachments:pg-gin-strange-initialization.diff (text/x-patch, 848B) download
# InvalidBlockNumber is -1 (or rather 0xFFFFFFFF), while
# the currently used InvalidBuffer is 0, which is a valid
# BlockNumber.
============================================================
*** src/backend/access/gin/ginbtree.c 2d3e63387737b4034fc25ca3cb128d9ac57f4f01
--- src/backend/access/gin/ginbtree.c 67351e1b6541b25ab3c8e8dc7a57487c2422e124
*************** ginInsertValue(GinBtree btree, GinBtreeS
*** 276,282 ****
ginInsertValue(GinBtree btree, GinBtreeStack *stack, GinStatsData *buildStats)
{
GinBtreeStack *parent = stack;
! BlockNumber rootBlkno = InvalidBuffer;
Page page,
rpage,
lpage;
--- 276,282 ----
ginInsertValue(GinBtree btree, GinBtreeStack *stack, GinStatsData *buildStats)
{
GinBtreeStack *parent = stack;
! BlockNumber rootBlkno = InvalidBlockNumber;
Page page,
rpage,
lpage;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: markus@bluegap.ch
Subject: Re: BlockNumber initialized to InvalidBuffer?
In-Reply-To: <4FFC292C.20703@bluegap.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox