Re: [sqlsmith] Crash in apply_projection_to_path - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [sqlsmith] Crash in apply_projection_to_path
Date
Msg-id 20754.1461895587@sss.pgh.pa.us
Whole thread Raw
In response to [sqlsmith] Crash in apply_projection_to_path  (Andreas Seltenreich <seltenreich@gmx.de>)
Responses Re: [sqlsmith] Crash in apply_projection_to_path  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Andreas Seltenreich <seltenreich@gmx.de> writes:
> the following query against the regression database crashes master as of
> 23b09e15.

> select 1 from depth0 inner join depth1 on (depth0.c = depth1.c)
>          where depth0.c @@ depth1.c limit 1;

What's going on here is that add_partial_path is recycling a now-dominated
partial path without regard for the fact that there's already a GatherPath
pointing at that old partial path.  Later use of the GatherPath tries to
make use of its now-dangling subpath pointer.

I'd be inclined to think that it's silly to build GatherPaths in advance
of having finalized the list of partial paths for a rel.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade 9.6->9.6: column "amtype" does not exist
Next
From: Tom Lane
Date:
Subject: Re: pg_xlog -> pg_xjournal?