Re: [PATCH]: fix bug in SP-GiST box_ops

From: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>
To: Tels <nospam-pg-abuse(at)bloodgate(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Emre Hasegeli <emre(at)hasegeli(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH]: fix bug in SP-GiST box_ops
Date: 2017-03-10 09:15:52
Message-ID: 48f6934b-b994-4aa2-b6ad-aaa4f5a12877@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10.03.2017 02:13, Tels wrote:

> I can't comment on the code, but the grammar on the comments caught my eye:
>> +/* Can any range from range_box does not extend higher than this argument? */
>> +static bool
>> +overLower2D(RangeBox *range_box, Range *query)
>> +{
>> + return FPle(range_box->left.low, query->high) &&
>> + FPle(range_box->right.low, query->high);
>> +}
> The sentence sounds quite garbled in English. I'm not entirely sure what
> it should be, but given the comment below "/* Can any range from range_box
> to be higher than this argument? */" maybe something like:
>
> /* Does any range from range_box extend to the right side of the query? */
>
> If used, an analog wording should be used for overHigher2D's comment like:
>
> /* Does any range from range_box extend to the left side of the query? */

I've changed comments as you proposed, but I've added missing "not" and left "Can":

/* Can any range from range_box not extend to the right side of the query? */
/* Can any range from range_box not extend to the left side of the query? */

See also comments on overhigher and overlower operators from documentation:

&< Does not extend to the right of?
&> Does not extend to the left of?

> Another question: Does it make sense to add the "minimal bad example for
> the '&<' case" as test case, too? After all, it should pass the test after
> the patch.

Yes, it will make sense, but the Kyotaro's test case doesn't work for me and
I still don't know how to force SP-GiST to create inner leaves without
inserting hundreds of rows.

--
Nikita Glukhov
Postgres Professional:http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
fix-bug-in-SP-GiST-box_ops-v04.patch text/x-patch 7.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2017-03-10 09:30:20 Re: Should we cacheline align PGXACT?
Previous Message Surafel Temesgen 2017-03-10 09:13:11 Re: New CORRESPONDING clause design