Wrong Assert in PageIndexMultiDelete?
Wrong Assert in PageIndexMultiDelete?
От:
Anastasia Lubennikova <lubennikovaav@gmail.com>
Дата:
Hi, hackers!
I am trying to create new index access method.
And I found strange Assert in PageIndexMultiDelete function.
Is '<' sign is correct? I thougt it should be '<='.
Is it a bug or just my misunderstanding?
Best regards,
Lubennikova Anastasia
Re: Wrong Assert in PageIndexMultiDelete?
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Anastasia Lubennikova writes: > I am trying to create new index access method. > And I found strange Assert in PageIndexMultiDelete > function. > Assert > (nitems > < MaxIndexTuplesPerPage > > ); > 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
Re: Wrong Assert in PageIndexMultiDelete?
От:
Heikki Linnakangas <hlinnaka@iki.fi>
Дата:
On 05/19/2015 07:15 PM, Tom Lane wrote: > Anastasia Lubennikova writes: >> I am trying to create new index access method. >> And I found strange Assert in PageIndexMultiDelete >> function. > >> Assert >> (nitems >> < MaxIndexTuplesPerPage >> >> ); > >> 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? No, it looks like a bug to me as well. Will fix... - Heikki