public inbox for [email protected]  
help / color / mirror / Atom feed
From: Álvaro Herrera <[email protected]>
To: Srinath Reddy Sadipiralla <[email protected]>
Cc: Ayush Tiwari <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: BUG #19491: Segmentation fault triggered by IS NULL
Date: Thu, 11 Jun 2026 16:27:17 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFC+b6pKHWbZMYnVmGoFv5hiSgf=_koiTXP-DF+cDZbRo+u-5w@mail.gmail.com>

On 2026-Jun-06, Srinath Reddy Sadipiralla wrote:

> On Fri, Jun 5, 2026 at 9:41 PM Ayush Tiwari <[email protected]>
> wrote:

> > Thanks, that reads better.  v2 attached, raising ERRCODE_CANNOT_COERCE
> > right where the coercion fails:
> >
> >   ERROR:  cannot cast type sqljson_mystr to text
> >
> > which also covers the JSON() WITH UNIQUE KEYS path.
> 
> Thanks for the updated patch, LGTM.

Thank you, I have pushed this to all branches since 16.

I also added an Assert() to makeJsonIsPredicate() that 'expr' is not
null.  This wouldn't have caught this problem, mind, because what was
really missing is an example case where the problem appears.  However,
it seems good manners to disallow that case explicitly rather than
have it return a Expr node with a embedded null pointer that's only
going to cause indirect problems.

BTW the subject of this thread is somehow comically bogus.  The problem
is IS JSON causing a NULL pointer dereference, not IS NULL.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/






view thread (7+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: BUG #19491: Segmentation fault triggered by IS NULL
  In-Reply-To: <[email protected]>

* 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