Thread

Commits

  1. Fix pull_varnos to cope with translated PlaceHolderVars.

  1. right join with partitioned table crash

    Jaime Casanova <jcasanov@systemguards.com.ec> — 2021-09-15T23:09:59Z

    Hi everyone,
    
    Here's another crash caught by sqlsmith.
    
    """
    drop table if exists fkpart3_pk5 cascade;
    drop table if exists inet_tbl;
    
    create table fkpart3_pk5 (
        a integer not null primary key
    )
    partition by range (a);
    
    create table fkpart3_pk51 partition of fkpart3_pk5
    	for values from (4000) to (4500);
    
    create table inet_tbl (
        c cidr,
        i inet
    );
    
    select
        1 as c0
    from
    	(select null::integer as c9,
    	        ref_0.a as c24
    	   from fkpart3_pk5 as ref_0
          	) as subq_0
          	right join public.inet_tbl as sample_0 on (cast(null as cidr) = c)
    where subq_0.c9 <= subq_0.c24
    """
    
    
    Attached the backtrace.
    
    -- 
    Jaime Casanova
    Director de Servicios Profesionales
    SystemGuards - Consultores de PostgreSQL
    
  2. Re: right join with partitioned table crash

    Tom Lane <tgl@sss.pgh.pa.us> — 2021-09-15T23:53:49Z

    Jaime Casanova <jcasanov@systemguards.com.ec> writes:
    > Here's another crash caught by sqlsmith.
    
    Fun.  Looks like it fails back to v12, but not in v11,
    so it's some optimization we added in v12 that's at fault.
    
    (That being the case, this isn't a blocker for 14rc1,
    though of course it'd be nice if we fix it in time for that.)
    
    			regards, tom lane
    
    
    
    
  3. Re: right join with partitioned table crash

    Justin Pryzby <pryzby@telsasoft.com> — 2021-09-16T04:42:58Z

    On Wed, Sep 15, 2021 at 07:53:49PM -0400, Tom Lane wrote:
    > Jaime Casanova <jcasanov@systemguards.com.ec> writes:
    > > Here's another crash caught by sqlsmith.
    > 
    > Fun.  Looks like it fails back to v12, but not in v11,
    > so it's some optimization we added in v12 that's at fault.
    
    It seems to be a regression (?) in 12.6 (2021-02-11), from
    | 1cce024fd2 Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar.
    
    -- 
    Justin
    
    
    
    
  4. Re: right join with partitioned table crash

    Tom Lane <tgl@sss.pgh.pa.us> — 2021-09-17T19:42:59Z

    Justin Pryzby <pryzby@telsasoft.com> writes:
    > On Wed, Sep 15, 2021 at 07:53:49PM -0400, Tom Lane wrote:
    >> Jaime Casanova <jcasanov@systemguards.com.ec> writes:
    >>> Here's another crash caught by sqlsmith.
    
    >> Fun.  Looks like it fails back to v12, but not in v11,
    >> so it's some optimization we added in v12 that's at fault.
    
    > It seems to be a regression (?) in 12.6 (2021-02-11), from
    > | 1cce024fd2 Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar.
    
    Yeah, that patch still had a hole in it.  Fix pushed,
    thanks for the report!
    
    			regards, tom lane