pgsql: Fix broken jsonb_set() logic for replacing array elements.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix broken jsonb_set() logic for replacing array elements.
Date: 2016-10-13 04:26:03
Message-ID: E1buXal-00072l-7k@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix broken jsonb_set() logic for replacing array elements.

Commit 0b62fd036 did a fairly sloppy job of refactoring setPath()
to support jsonb_insert() along with jsonb_set(). In its defense,
though, there was no regression test case exercising the case of
replacing an existing element in a jsonb array.

Per bug #14366 from Peng Sun. Back-patch to 9.6 where bug was introduced.

Report: <20161012065349(dot)1412(dot)47858(at)wrigleys(dot)postgresql(dot)org>

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0e9e64c07ed93fb2be4583adaea28205d3188a0e

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 12 ++++++------
src/test/regress/expected/jsonb.out | 6 ++++++
src/test/regress/sql/jsonb.sql | 1 +
3 files changed, 13 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2016-10-13 12:38:32 Re: pgsql: Make pg_dumpall's database ACL query independent of hash table o
Previous Message Michael Paquier 2016-10-13 04:21:05 Re: Re: [COMMITTERS] pgsql: Extend framework from commit 53be0b1ad to report latch waits.