Re: jsonb crash - Mailing list pgsql-hackers

From Tom Lane
Subject Re: jsonb crash
Date
Msg-id 2998377.1632945612@sss.pgh.pa.us
Whole thread Raw
In response to jsonb crash  (Jaime Casanova <jcasanov@systemguards.com.ec>)
Responses Re: jsonb crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: jsonb crash  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: [BUG] failed assertion in EnsurePortalSnapshotExists()
Next
From: Tom Lane
Date:
Subject: Re: [BUG] failed assertion in EnsurePortalSnapshotExists()