Re: array_agg(DISTINCT) caused a segmentation fault - Mailing list pgsql-bugs

From David Rowley
Subject Re: array_agg(DISTINCT) caused a segmentation fault
Date
Msg-id CAApHDvrdsHDDnFLZJ9hvaodyYkajdtaqub7Ss-Eq4sY4FYZW5A@mail.gmail.com
Whole thread Raw
In response to Re: array_agg(DISTINCT) caused a segmentation fault  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: array_agg(DISTINCT) caused a segmentation fault  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-bugs
On Mon, 13 Feb 2023 at 23:00, Alexander Lakhin <exclusion@gmail.com> wrote:
> I've encountered an issue that could have the same title but it still reproduced after the fix.
> The following query:
> SELECT array_agg(DISTINCT a ORDER BY a DESC)
>           FROM (VALUES (1),(1.0),(NULL)) v(a);

Thanks for testing that.  I neglected to update the logic which pfrees
the old Datum, which (as of 7da51590e) may now be NULL.

I've just pushed a fix.

David



pgsql-bugs by date:

Previous
From: xianliang.ji@esgyn.cn
Date:
Subject: Optimizer failed to generate plan
Next
From: David Rowley
Date:
Subject: Re: Optimizer failed to generate plan