Re: array_agg(DISTINCT) caused a segmentation fault

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: array_agg(DISTINCT) caused a segmentation fault
Дата
Msg-id CAApHDvrWu0G1caebi21=pELRtpcyu+1sDvo_c-vkogYJ=tQrvA@mail.gmail.com
обсуждение исходный текст
Ответ на array_agg(DISTINCT) caused a segmentation fault  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Ответы Re: array_agg(DISTINCT) caused a segmentation fault  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Re: array_agg(DISTINCT) caused a segmentation fault  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-bugs
On Mon, 13 Feb 2023 at 18:29, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> =# SELECT array_agg(distinct val) FROM (SELECT NULL AS val FROM generate_series(1, 2)) hoge;
> LOG:  server process (PID 76507) was terminated by signal 11: Segmentation fault: 11
> DETAIL:  Failed process was running: SELECT array_agg(distinct val) FROM (SELECT NULL AS val FROM generate_series(1,
2))hoge;
 

This was a fairly trivial logic bug in
ExecEvalPreOrderedDistinctSingle(). The JIT code calls that same
function and ExecEvalPreOrderedDistinctMulti() uses the standard
expression evaluation logic.  So looks like the problem is just
isolated to ExecEvalPreOrderedDistinctSingle().

I've now pushed a fix for it and included your test.  To get it to
crash it needed to be a byref aggregate without a strict transition
function.  There are not too many of those, which is probably why
nobody noticed this before.

David



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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: array_agg(DISTINCT) caused a segmentation fault