pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: b.yordanov2@gmail.com, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function
Date: Thu, 15 Oct 2015 12:50:52 -0400
Message-ID: <5488.1444927852@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqS4ha2+d7oyTetqEMy8uLaG=n+uwK=XCPPdc+xZSSDtfA@mail.gmail.com>
References: <20151014160818.3034.13514@wrigleys.postgresql.org>
	<CAB7nPqTAtzikH1MaQy2kbN7PS69Du+O5mFwkC6x_xNwo_KdCvw@mail.gmail.com>
	<CAB7nPqS4ha2+d7oyTetqEMy8uLaG=n+uwK=XCPPdc+xZSSDtfA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Michael Paquier <michael.paquier@gmail.com> writes:
> It happens that jsonb_object_agg_transfn is not able to manage
> correctly NULL values in the context of a JSONB value, and it seems to
> me that this is caused by an oversight in datum_to_jsonb regarding the
> handling of NULL values.

> Attached is a patch with some regression tests for master and
> REL9_5_STABLE where the bug has been introduced.

This looks sane to me, although since the function's header comment
specifies that tcategory is not to be relied on when is_null is true,
I think it would be cleaner to test is_null before looking at tcategory.
Will adjust and push.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)  latest in thread

Message-ID: <5488.1444927852@sss.pgh.pa.us>
Permalink:  ../5488.1444927852@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5488.1444927852@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com
  Subject: Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function
  In-Reply-To: <5488.1444927852@sss.pgh.pa.us>
  References: <20151014160818.3034.13514@wrigleys.postgresql.org> <CAB7nPqTAtzikH1MaQy2kbN7PS69Du+O5mFwkC6x_xNwo_KdCvw@mail.gmail.com> <CAB7nPqS4ha2+d7oyTetqEMy8uLaG=n+uwK=XCPPdc+xZSSDtfA@mail.gmail.com> <5488.1444927852@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox