pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: pgsql-hackers@postgresql.org, David Rowley <drowley@postgresql.org>
Subject: Re: jsonb crash
Date: Wed, 29 Sep 2021 16:00:12 -0400
Message-ID: <2998377.1632945612@sss.pgh.pa.us> (raw)
In-Reply-To: <20210929185544.GB24346@ahch-to>
References: <20210929185544.GB24346@ahch-to>

Jaime Casanova <jcasanov@systemguards.com.ec> writes:
> I found a crash (segmentation fault) on jsonb.
> This is the best I could do to reduce the query:

> """
> select  
>   75 as c1
> from 
>   public.pagg_tab_ml as ref_0,
>   lateral (select  
>         ref_0.a as c5 
>       from generate_series(1, 300) as sample_0
>       fetch first 78 rows only
>       ) as subq_0
> where case when (subq_0.c5 < 2) 
>            then cast(null as jsonb) 
> 	   else cast(null as jsonb) 
>       end ? ref_0.c
> """

I think this must be a memoize bug.  AFAICS, nowhere in this query
can we be processing a non-null JSONB value, so what are we doing
in jsonb_hash?  Something down-stack must have lost the information
that the Datum is actually null.

			regards, tom lane





view thread (23+ messages)  latest in thread

Message-ID: <2998377.1632945612@sss.pgh.pa.us>
Permalink:  ../2998377.1632945612@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2998377.1632945612@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jcasanov@systemguards.com.ec, drowley@postgresql.org
  Subject: Re: jsonb crash
  In-Reply-To: <2998377.1632945612@sss.pgh.pa.us>
  References: <20210929185544.GB24346@ahch-to> <2998377.1632945612@sss.pgh.pa.us>

* 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