Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id B6790C83CAF for ; Tue, 10 Jul 2012 10:12:33 -0300 (ADT) Received: from shaykin.bluegap.ch ([78.46.81.73]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SoaAj-0004Jj-L7 for pgsql-hackers@postgresql.org; Tue, 10 Jul 2012 13:08:15 +0000 Received: from [10.80.16.200] (adsl-84-227-238-34.adslplus.ch [::ffff:84.227.238.34]) (AUTH: LOGIN markus@bluegap.ch, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by shaykin.bluegap.ch with esmtp; Tue, 10 Jul 2012 15:19:01 +0200 id 00000000015880E6.000000004FFC2BC5.00006453 Message-ID: <4FFC292C.20703@bluegap.ch> Date: Tue, 10 Jul 2012 15:07:56 +0200 From: Markus Wanner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_shaykin.bluegap.ch-25683-1341926342-0001-2" To: pgsql-hackers Subject: BlockNumber initialized to InvalidBuffer? X-Enigmail-Version: 1.4.1 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/430 X-Sequence-Number: 211113 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_shaykin.bluegap.ch-25683-1341926342-0001-2 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit 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 --=_shaykin.bluegap.ch-25683-1341926342-0001-2 Content-Type: text/x-patch; name="pg-gin-strange-initialization.diff"; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pg-gin-strange-initialization.diff" # 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; --=_shaykin.bluegap.ch-25683-1341926342-0001-2--