Re: BUG #17067: FailedAssertion at castNodeImpl

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: cyg0810(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17067: FailedAssertion at castNodeImpl
Date: 2021-06-21 10:09:57
Message-ID: CAMbWs4_iRT7BDQovtX9Eihu=UDh4G6hRDOpm=piBtSUm+5Oodw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jun 21, 2021 at 5:48 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:

> On Mon, 21 Jun 2021 at 20:15, PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
> > run the following sql command through client and the PostgreSQL database
> > process will crash:
> >
> > CREATE TABLE v0 ( v1 FLOAT NOT NULL PRIMARY KEY ) ;
> > WITH v1 AS ( DELETE FROM v0 WHERE v1 <= - - - 9 RETURNING * ) INSERT
> INTO v0
> > VALUES ( - - - - - - 95 ) ;
> > SELECT v1 FROM ( SELECT * FROM v0 UNION ALL SELECT * FROM v0 GROUP BY
> > DISTINCT ROLLUP ( v1 , v1 ) , ROLLUP ( v1 , USER ) , GROUPING SETS ( ROW
> ( )
> > , ( v1 ) ) , ROLLUP ( v1 < - - 61 AND v1 IN ( -2147483648 , - 94 ) , v1
> ) )
> > v1 ORDER BY ( v1 + - - -1 ) , ( v1 + - - v1 IN ( SELECT v1 FALSE FROM (
> > SELECT FROM v0 GROUP BY v1 ) PRECISION ) ) ;
>
> Thanks for the report. It looks like a thinko in 1d581ce71. Code
> was added there which insists the initial list element is a List, but
> it's an IntList. I think the code should just use linitial instead of
> linitial_node.
>
> I'm quite surprised that we don't have a test that picks this up.
>

A distinct group by clause would help to reveal this issue as:

explain select * from t GROUP BY distinct a, rollup(b);

Maybe we can add a test case to cover it.

Thanks
Richard

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2021-06-21 11:13:43 Re: BUG #17067: FailedAssertion at castNodeImpl
Previous Message David Rowley 2021-06-21 10:09:30 Re: BUG #17067: FailedAssertion at castNodeImpl