Re: BUG #15578: Executing json_populate_recordset with an empty array causes a segmentation fault - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15578: Executing json_populate_recordset with an empty array causes a segmentation fault
Date
Msg-id 13027.1546837948@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15578: Executing json_populate_recordset with an empty arraycauses a segmentation fault  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> When executing json_populate_recordset/jsonb_populate_recordset with an
> empty array, a segmentation fault occurs and the server process is
> terminated. The issue occurs regardless of the type used. In previous
> versions this would return null.
> Example:
> CREATE TYPE test_type AS (amount numeric, description text);
> SELECT * FROM json_populate_recordset(null::test_type,'[]');

Hm, this example works for me in HEAD and 11 branch tip, so I'm
guessing it was fixed by this commit:

https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=595220a3a

That'll be out in 11.2, or you can apply the patch locally if
you're in a hurry.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15578: Executing json_populate_recordset with an emptyarray causes a segmentation fault
Next
From: Bartosz Polnik
Date:
Subject: Re: BUG #15577: Query returns different results when executedmultiple times