Re: array_agg(DISTINCT) caused a segmentation fault

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: array_agg(DISTINCT) caused a segmentation fault
Date: 2023-02-13 10:41:06
Message-ID: CAApHDvrdsHDDnFLZJ9hvaodyYkajdtaqub7Ss-Eq4sY4FYZW5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, 13 Feb 2023 at 23:00, Alexander Lakhin <exclusion(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2023-02-13 11:40:30 Re: Optimizer failed to generate plan
Previous Message xianliang.ji 2023-02-13 10:24:45 Optimizer failed to generate plan