Re: BUG #14344: string_agg(DISTINCT ..) crash

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: BUG #14344: string_agg(DISTINCT ..) crash
Дата
Msg-id CAM3SWZTQcmnutjza3GdLLC-Y4WmF_FKAfAxLF4EMVK_dS3RsEQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #14344: string_agg(DISTINCT ..) crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #14344: string_agg(DISTINCT ..) crash
Список pgsql-bugs
On Thu, Sep 29, 2016 at 4:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> My immediate reaction to this is WTF.  It seems like you have completely
> broken the expected contract of tuplesort_gettupleslot, which is that
> it copies the data into caller-owned memory.  That cannot stand.

Other comparable routines, like tuplesort_getindextuple(), could be
argued to have always had a contract that allows for this kind of
thing (recycling batch memory) because they get to examine a
*should_free pointer -- do you accept that much?
tuplesort_gettupleslot() does that for callers that happen to want to
use a tuple slot, rather than a direct caller tuple. So, it doesn't
seem like there is a very hard distinction there; that could also have
broken something in an extension too, since the lifetime of memory
controlled by tuplesort (should_free = false cases, managed by
tuplesort memory context) was always a bit unclear.

--
Peter Geoghegan

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14344: string_agg(DISTINCT ..) crash
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #14344: string_agg(DISTINCT ..) crash