agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Manu <manuelreyesbravo@gmail.com>
To: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org, Amit Langote <amitlangote09@gmail.com>
Cc: chaitanyyachoudhary@gmail.com
Subject: Re: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL
Date: Thu, 24 Sep 2026 17:49:27 -0300
Message-ID: <179028296766.3788466.15613172266972648668@gmail.com> (raw)
In-Reply-To: <CAFC+b6q5GZFvkpQV1tmioEjY=d-N+3LYCnUPo5bV0LbG95+N8A@mail.gmail.com>
References: <CAFC+b6q5GZFvkpQV1tmioEjY=d-N+3LYCnUPo5bV0LbG95+N8A@mail.gmail.com>
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.
Regards,
Manu
diff -U3 src/test/regress/expected/sqljson_queryfuncs.out src/test/regress/results/sqljson_queryfuncs.out
--- src/test/regress/expected/sqljson_queryfuncs.out 2026-09-24 17:47:09.462663202 -0300
+++ src/test/regress/results/sqljson_queryfuncs.out 2026-09-24 17:47:14.260184729 -0300
@@ -557,7 +557,7 @@
-- Test state leakage of null flags in JSON_VALUE with RETURNING json/jsonb
-- (Checks that a NULL evaluation doesn't poison subsequent evaluations in the same statement)
-- 1. Same statement, separate columns (JSONB)
-SELECT JSON_VALUE('null', '$' RETURNING jsonb) AS col1,
+SELECT JSON_VALUE('null', '$' RETURNING jsonb) AS col1,
JSON_VALUE('123', '$' RETURNING jsonb) AS col2;
col1 | col2
------+------
@@ -565,7 +565,7 @@
(1 row)
-- 2. Across multiple rows (JSONB)
-SELECT JSON_VALUE(x, '$' RETURNING jsonb)
+SELECT JSON_VALUE(x, '$' RETURNING jsonb)
FROM (VALUES ('1'::jsonb), ('null'), ('2')) v(x);
json_value
------------
@@ -575,7 +575,7 @@
(3 rows)
-- 3. Same statement, separate columns (JSON)
-SELECT JSON_VALUE('null', '$' RETURNING json) AS col1,
+SELECT JSON_VALUE('null', '$' RETURNING json) AS col1,
JSON_VALUE('123', '$' RETURNING json) AS col2;
col1 | col2
------+------
@@ -583,7 +583,7 @@
(1 row)
-- 4. Across multiple rows (JSON)
-SELECT JSON_VALUE(x, '$' RETURNING json)
+SELECT JSON_VALUE(x, '$' RETURNING json)
FROM (VALUES ('1'::json), ('null'), ('2')) v(x);
json_value
------------
Attachments:
[text/plain] nocfbot-v2-regression.diffs.txt (1.4K, ../179028296766.3788466.15613172266972648668@gmail.com/2-nocfbot-v2-regression.diffs.txt)
download | inline:
diff -U3 src/test/regress/expected/sqljson_queryfuncs.out src/test/regress/results/sqljson_queryfuncs.out
--- src/test/regress/expected/sqljson_queryfuncs.out 2026-09-24 17:47:09.462663202 -0300
+++ src/test/regress/results/sqljson_queryfuncs.out 2026-09-24 17:47:14.260184729 -0300
@@ -557,7 +557,7 @@
-- Test state leakage of null flags in JSON_VALUE with RETURNING json/jsonb
-- (Checks that a NULL evaluation doesn't poison subsequent evaluations in the same statement)
-- 1. Same statement, separate columns (JSONB)
-SELECT JSON_VALUE('null', '$' RETURNING jsonb) AS col1,
+SELECT JSON_VALUE('null', '$' RETURNING jsonb) AS col1,
JSON_VALUE('123', '$' RETURNING jsonb) AS col2;
col1 | col2
------+------
@@ -565,7 +565,7 @@
(1 row)
-- 2. Across multiple rows (JSONB)
-SELECT JSON_VALUE(x, '$' RETURNING jsonb)
+SELECT JSON_VALUE(x, '$' RETURNING jsonb)
FROM (VALUES ('1'::jsonb), ('null'), ('2')) v(x);
json_value
------------
@@ -575,7 +575,7 @@
(3 rows)
-- 3. Same statement, separate columns (JSON)
-SELECT JSON_VALUE('null', '$' RETURNING json) AS col1,
+SELECT JSON_VALUE('null', '$' RETURNING json) AS col1,
JSON_VALUE('123', '$' RETURNING json) AS col2;
col1 | col2
------+------
@@ -583,7 +583,7 @@
(1 row)
-- 4. Across multiple rows (JSON)
-SELECT JSON_VALUE(x, '$' RETURNING json)
+SELECT JSON_VALUE(x, '$' RETURNING json)
FROM (VALUES ('1'::json), ('null'), ('2')) v(x);
json_value
------------
view thread (6+ messages)
Message-ID: <179028296766.3788466.15613172266972648668@gmail.com>
Permalink: ../179028296766.3788466.15613172266972648668@gmail.com/
Also on: postgresql.org/message-id/179028296766.3788466.15613172266972648668@gmail.com
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: manuelreyesbravo@gmail.com, srinath2133@gmail.com, amitlangote09@gmail.com, chaitanyyachoudhary@gmail.com
Subject: Re: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL
In-Reply-To: <179028296766.3788466.15613172266972648668@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox