Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much - Mailing list pgsql-bugs

From Dmitry Dolgov
Subject Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much
Date
Msg-id CA+q6zcU=6CcmdAdW=J9o-ukmyKYLLL=6-cHYPZNLN5JQr4wRRw@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
> On 13 October 2017 at 06:29, Michael Paquier <michael.paquier@gmail.com> wrote:
>
> So I have implemented a patch that fills in intermediate state data when dong
> a variadic call and feeds that to the JSONB constructor.

Shouldn't `jsonb_build_object` and `jsonb_build_array` be strict in this patch?
Otherwise one can get a segfault for these cases:

```
=# select jsonb_build_object(variadic NULL::text[]);
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

=# select jsonb_build_array(variadic NULL::text[]);
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
```

pgsql-bugs by date:

Previous
From: alexey.ermakov@dataegret.com
Date:
Subject: [BUGS] BUG #14852: Refreshing materialized view might lead to a problem"could not access status of transaction"
Next
From: Michael Paquier
Date:
Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much