Re: sqlsmith crash incremental sort

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: James Coleman <jtc331@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-04-17T09:03:34Z
Lists: pgsql-hackers
On Fri, Apr 17, 2020 at 7:13 AM Tomas Vondra <tomas.vondra@2ndquadrant.com>
wrote:

> On Thu, Apr 16, 2020 at 08:44:16PM +0200, Tomas Vondra wrote:
> >
> >Yeah, that's not entirely close to me. But maybe it shows us where we to
> >get the unprocessed target list?
> >
>
> I think at the very least this needs to apply the same change also to
> generate_nonunion_paths, because otherwise this fails because of the
> same issue:
>
>    set enable_hashagg = off;
>    explain select * from foo except select * from foo order by 1, 3;
>

Ah yes, that's what I'll have to do to cope with EXCEPT/INTERSECT.

Thanks
Richard

Commits

  1. Simplify cost_incremental_sort a bit

  2. Fix cost_incremental_sort for expressions with varno 0