Re: BUG #19956: json #>, #>> and json_extract_path resolve a negative array index against an earlier sibling array

From: Ishjaap Singh <ishjaap(dot)singh07(at)gmail(dot)com>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: e1638616(at)u(dot)nus(dot)edu, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19956: json #>, #>> and json_extract_path resolve a negative array index against an earlier sibling array
Date: 2026-12-03 18:36:03
Message-ID: CA+Y2BmfMsa=fe4E_mhXfzqxsBb4jSvgopMQGYryJc_r3q710hw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Andrey,

Thanks, v2 looks good to me.

On master (d637007e62a) it applies, builds without warnings and passes
make check. Six of the nine new tests fail without the code change.
The {a,-3} one passes on master too, as it should, since it covers the
case v1 got wrong.

I compared json #>, #>> and json_extract_path with jsonb on 55 paths:
the 30 from before, plus 25 with duplicate keys at different levels,
three copies of a key, and arrays and negative indexes under a
duplicate key. With v2 all of them match jsonb. Master differs on 15
of the 25.

v2 applies to REL_19_STABLE. 18 and older need their own version
because of palloc_array().

I think this is ready for a committer.

Regards,
Ishjaap Singh

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kirill Reshke 2026-12-03 18:42:58 Re: btree_gist: <-> fails on same-sign infinite intervals
Previous Message Tom Lane 2026-12-03 18:34:02 Re: btree_gist: <-> fails on same-sign infinite intervals