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-00000000MgZ-3H83@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
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c1694b7b962c8b8031bc115bfca2f21e7a156654
Modified Files
--------------
src/backend/optimizer/util/clauses.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
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-00000000MgZ-3H83@gemulon.postgresql.org>
References: <E1xRH40-00000000MgZ-3H83@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