Re: Avoid use scoped block variable

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Avoid use scoped block variable
Дата
Msg-id b5f92b03-70d6-4958-b9b0-111fab0f2ab6@vondra.me
обсуждение исходный текст
Ответ на Avoid use scoped block variable  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
On 12/9/25 17:06, Ranier Vilela wrote:
> Hi.
> 
> I noticed a possible violation of C rules.
> Some functions rely on local block variables, 
> but this are a mistake.
> Once that block exits, the memory of the variable is released.
> 
> Fix by moving the declaration variables.
> 

When you say "possible violation", did you check the issue is real?

All these places call CStringGetTextDatum, which calls cstring_to_text,
which allocates a new varlena copy of the string. So why is this an
issue, exactly?


regards

-- 
Tomas Vondra




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