Re: Avoid recalculating pgprocno in ProcArrayAdd()

Поиск
Список
Период
Сортировка
От Chao Li
Тема Re: Avoid recalculating pgprocno in ProcArrayAdd()
Дата
Msg-id 667B43E6-B6AA-4AF1-86F1-C2C9B9B96E04@gmail.com
обсуждение исходный текст
Ответ на Avoid recalculating pgprocno in ProcArrayAdd()  (Shinya Kato <shinya11.kato@gmail.com>)
Ответы Re: Avoid recalculating pgprocno in ProcArrayAdd()
Список pgsql-hackers

> On Jan 22, 2026, at 13:34, Shinya Kato <shinya11.kato@gmail.com> wrote:
>
> Hi hackers,
>
> I have fixed the issue mentioned in the subject. This was introduced
> in commit 28f3915b7.
>
> --
> Best regards,
> Shinya Kato
> NTT OSS Center
> <v1-0001-Avoid-recalculating-pgprocno-in-ProcArrayAdd.patch>

LGTM. This is not correctness fix.

```
void
ProcArrayAdd(PGPROC *proc)
{
// GetNumberFromPGProc(proc) has been stored in a local variable
    int            pgprocno = GetNumberFromPGProc(proc);

// Later, the local variable should be used. This patch changes GetNumberFromPGProc(proc) to pgprocno here.
        arrayP->pgprocnos[index] = GetNumberFromPGProc(proc);
```

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







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