Re: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Manu <manuelreyesbravo(at)gmail(dot)com>
Cc: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, chaitanyyachoudhary(at)gmail(dot)com
Subject: Re: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL
Date: 2026-11-05 03:41:11
Message-ID: CA+HiwqHm+-wMW6vGiPV8RQNqqgyUZ+FU5K19TpziActyfzX7Fw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Sep 25, 2026 at 5:49 AM Manu <manuelreyesbravo(at)gmail(dot)com> wrote:
>
> Hi Srinath,
>
> > I fixed the whitespace errors in this v2 patch.
>
> Thanks. v2 removes the trailing spaces from the four queries in
> sqljson_queryfuncs.sql, but not from the same four lines in
> expected/sqljson_queryfuncs.out, which echoes them, so on master
> (89829354de1) the test now fails on whitespace alone. The
> regression.diffs is attached; the query results themselves are right.
>
> With the trailing spaces removed from those four lines of the .out as
> well, the test passes. Sorry for the extra round, it was my nit.

Thank you all for working on this. That is indeed an oversight on my part.

I'll push the attached patch in a bit. It’s mostly Srinath’s v2 with
some test adjustments and some commit message polishing.

--
Thanks, Amit Langote

Attachment Content-Type Size
v3-0001-SQL-JSON-Fix-NULL-result-leakage-in-JSON_VALUE-RE.patch application/octet-stream 5.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message shihao zhong 2026-11-05 00:48:22 Re: first_value()/nth_value() with IGNORE NULLS loop forever (EXCLUDE GROUP/TIES, frame past partition end, no ORDER BY)