diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-30 12:29:21 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-30 12:29:21 -0400 |
commit | c45bf5751b6338488bd79ce777210285531da373 (patch) | |
tree | 35684865b22644359c5109f0583ac68cc9ebb321 /src/backend/utils/adt/numeric.c | |
parent | 17d5db352c1780f4721664f67bc3a3f3b1cf933c (diff) | |
download | postgresql-c45bf5751b6338488bd79ce777210285531da373.tar.gz postgresql-c45bf5751b6338488bd79ce777210285531da373.zip |
Fix planner crash from pfree'ing a partial path that a GatherPath uses.
We mustn't run generate_gather_paths() during add_paths_to_joinrel(),
because that function can be invoked multiple times for the same target
joinrel. Not only is it wasteful to build GatherPaths repeatedly, but
a later add_partial_path() could delete the partial path that a previously
created GatherPath depends on. Instead establish the convention that we
do generate_gather_paths() for a rel only just before set_cheapest().
The code was accidentally not broken for baserels, because as of today there
never is more than one partial path for a baserel. But that assumption
obviously has a pretty short half-life, so move the generate_gather_paths()
calls for those cases as well.
Also add some generic comments explaining how and why this all works.
Per fuzz testing by Andreas Seltenreich.
Report: <871t5pgwdt.fsf@credativ.de>
Diffstat (limited to 'src/backend/utils/adt/numeric.c')
0 files changed, 0 insertions, 0 deletions