Re: [HACKERS] tuplesort_gettuple_common() and *should_free argument

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: [HACKERS] tuplesort_gettuple_common() and *should_free argument
Дата
Msg-id CAM3SWZS8UoP1Bhy7NHHKVMwFGzSKQeLf3W+y7pMoX5Mn43fw6g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] tuplesort_gettuple_common() and *should_free argument  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [HACKERS] tuplesort_gettuple_common() and *should_free argument  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, Dec 12, 2016 at 9:31 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> I think this patch might have a bug.  In the existing code,
> tuplesort_gettupleslot sets should_free = true if it isn't already
> just before calling ExecStoreMinimalTuple((MinimalTuple) stup.tuple,
> slot, should_free), so it seems that ExecStoreMinimalTuple() will
> always get "true" as the fourth argument. However the patch changes
> that line of code like this:
>
> +        ExecStoreMinimalTuple((MinimalTuple) stup.tuple, slot, false);
>
> So the patch seems to have the effect of changing the fourth argument
> to this call to ExecStoreMinimalTuple() from always-true to
> always-false.  I might be missing something, but my guess is that's
> not right.

There was a memory leak added by 0001-*, but then fixed by 0002-*. I
should have done more testing of 0001-* alone. Oops.

Attached revision of 0001-* fixes this. A revised 0002-* is also
attached, just as a convenience for reviewers (they won't need to
resolve the conflict themselves).

-- 
Peter Geoghegan

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: [HACKERS] [OSSTEST PATCH 0/1] PostgreSQL db: Retry on constraint violation
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] Nested Wait Events?