Re: Wrong Assert in PageIndexMultiDelete?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Anastasia Lubennikova <lubennikovaav(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Wrong Assert in PageIndexMultiDelete?
Date: 2015-05-19 16:15:58
Message-ID: 11861.1432052158@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Anastasia Lubennikova <lubennikovaav(at)gmail(dot)com> writes:
> I am trying to create new index access method.
> And I found strange Assert in PageIndexMultiDelete
> <http://doxygen.postgresql.org/bufpage_8c_source.html#l00791> function.

> Assert
> <http://doxygen.postgresql.org/c_8h.html#a706ac5b1a53bd04067f81924b92cb9f6>(nitems
> < MaxIndexTuplesPerPage
> <http://doxygen.postgresql.org/itup_8h.html#adb7c94e95ce112eb47d71f7797604ddb>
> );

> Is '<' sign is correct? I thougt it should be '<='.
> Is it a bug or just my misunderstanding?

Hm, I think it's a bug. It's probably not very significant because
MaxIndexTuplesPerPage is an overestimate (it doesn't account for index
special space), but it's wrong AFAICS.

That Assert hasn't been there very long, either --- seems to have been
added in 877b0887. Heikki, did you have some specific reason for writing
it like that?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-05-19 16:20:40 Re: Wrong Assert in PageIndexMultiDelete?
Previous Message John Gorman 2015-05-19 16:12:36 errmsg() clobbers errno