| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> |
| Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Fix comments on _bt_skiparray_strat_increment/decrement |
| Date: | 2025-12-31 03:36:56 |
| Message-ID: | D1C745AA-A62B-467F-81A8-2EB466A5BBC6@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Dec 30, 2025, at 18:01, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
>
> Hi,
>
> The attached patch is a trivial change to fix the comments on
> _bt_skiparray_strat_increment() and _bt_skiparray_strat_decrement() so
> that they are consistent with the comments on _bt_skiparray_strat_adjust().
> At least the comment on _bt_skiparray_strat_decrement() containts an
> obvious typo, since it mentions converting the high_compare key instead of
> the low_compare key.
>
> Regards,
> Yugo Nagata
>
> --
> Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
> <fix_comments_on_bt_skiparray_strat_dec_inc_func.patch>
Good catch. Looks like a copy/paste mistake.
The code snippet prove the 2 functions' header comments are wrong:
```
/*
* Convert skip array's < low_compare key into a <= key
*/
static void
_bt_skiparray_strat_increment(IndexScanDesc scan, ScanKey arraysk,
BTArrayKeyInfo *array)
{
…
if (RegProcedureIsValid(cmp_proc))
{
/* Transform > low_compare key into >= key */
fmgr_info(cmp_proc, &low_compare->sk_func);
low_compare->sk_argument = new_sk_argument;
low_compare->sk_strategy = BTGreaterEqualStrategyNumber;
}
```
And
```
/*
* Convert skip array's > low_compare key into a >= key
*/
static void
_bt_skiparray_strat_decrement(IndexScanDesc scan, ScanKey arraysk,
BTArrayKeyInfo *array)
{
…
if (RegProcedureIsValid(cmp_proc))
{
/* Transform < high_compare key into <= key */
fmgr_info(cmp_proc, &high_compare->sk_func);
high_compare->sk_argument = new_sk_argument;
high_compare->sk_strategy = BTLessEqualStrategyNumber;
}
```
I also think we can delete “a” from the header comments. “into a >= key”, where “a” is an article (meaning one), but can be easily read as a variable name. The code comments don’t use “a” after “into”.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | wenhui qiu | 2025-12-31 03:46:16 | Re: [PATCH] Typo fix in fk-snapshot-3.spec |
| Previous Message | jian he | 2025-12-31 02:57:14 | Re: disallow alter individual column if partition key contains wholerow reference |