pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix incorrect early exit from contain_mutable_functions_walker.
Date: Wed, 11 Nov 2026 22:45:08 +0000
Message-ID: <E1xRH40-00000000Mgb-3Mho@gemulon.postgresql.org> (raw)

Fix incorrect early exit from contain_mutable_functions_walker.

Given a JsonExpr.path_spec that is a null constant,
contain_mutable_functions_walker immediately returned false, failing
to check for other sources of mutability elsewhere in the JsonExpr.
It must only skip the jspIsMutable() test in this case.

While here, remove a couple of redundant castNode calls (I'm not
a fan of using that directly after an explicit IsA check).

Bug: #19840
Reported-by: chunling qin <303677365@qq.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19840-7d5243be84d7ecd3@postgresql.org
Backpatch-through: 17

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b52f3db885db1a8d8723f32db2ff35ea02ca6044

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1xRH40-00000000Mgb-3Mho@gemulon.postgresql.org>
Permalink:  ../E1xRH40-00000000Mgb-3Mho@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xRH40-00000000Mgb-3Mho@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix incorrect early exit from contain_mutable_functions_walker.
  In-Reply-To: <E1xRH40-00000000Mgb-3Mho@gemulon.postgresql.org>
  References: <E1xRH40-00000000Mgb-3Mho@gemulon.postgresql.org>

* 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