Re: [PATCH] Remove twice assignment with var pageop (nbtree.c).

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [PATCH] Remove twice assignment with var pageop (nbtree.c).
Дата
Msg-id 20191219161959.GN30116@momjian.us
обсуждение исходный текст
Ответ на Re: [PATCH] Remove twice assignment with var pageop (nbtree.c).  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы RE: [PATCH] Remove twice assignment with var pageop (nbtree.c).  (Ranier Vilela <ranier_gyn@hotmail.com>)
Список pgsql-hackers
On Thu, Dec 19, 2019 at 10:55:42AM -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > On Tue, Nov 26, 2019 at 01:45:10PM +0000, Ranier Vilela wrote:
> >> Same case on nbtpage.c at line 1637, with var opaque.
> >> make check, passed all 195 tests here with all commits.
> 
> > You were right about both of these, so removed in master.  I am
> > surprised no one else saw this before.
> 
> I don't think this is actually a good idea.  What it is is a foot-gun,
> because if anyone adds code there that wants to access the special area
> of that particular page, it'll do the wrong thing, unless they remember
> to put back the assignment of "opaque".  The sequence of BufferGetPage()
> and PageGetSpecialPointer() is a very standard switch-our-attention-
> to-another-page locution in nbtree and other index AMs.

Oh, I was not aware that was boilerplate code.  I agree it should be
consistent, so patch reverted.  Sorry.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Proposal: Global Index
Следующее
От: Arseny Sher
Дата:
Сообщение: Re: Too rigorous assert in reorderbuffer.c