Skip site navigation (1) Skip section navigation (2)

Re: BUG #5673: Optimizer creates strange execution plan leading to wrong results

From: David Schmitt <david(at)dasz(dot)at>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5673: Optimizer creates strange execution plan leading to wrong results
Date: 2010-09-24 08:19:14
Message-ID: 4C9C5F02.3070705@dasz.at (view raw or flat)
Thread:
Lists: pgsql-bugs
On 9/23/2010 9:53 PM, Tom Lane wrote:
> David Schmitt<david(at)dasz(dot)at>  writes:
>> Executing the attached example.sql on a fresh database demonstrates the
>> problem I'm seeing:
>
> Found it.  If you need a patch right away, it's a one-liner:
>
> diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
> index 2d86da3..b7cf0b8 100644
> --- a/src/backend/optimizer/path/allpaths.c
> +++ b/src/backend/optimizer/path/allpaths.c
> @@ -425,7 +425,7 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
>   		childpath = childrel->cheapest_total_path;
>   		if (IsA(childpath, AppendPath))
>   			subpaths = list_concat(subpaths,
> -								   ((AppendPath *) childpath)->subpaths);
> +							list_copy(((AppendPath *) childpath)->subpaths));
>   		else
>   			subpaths = lappend(subpaths, childpath);
>


Thank you very very much, you made my day! *phew*


Best Regards, David
-- 
dasz.at OG              Tel: +43 (0)664 2602670     Web: http://dasz.at
Klosterneuburg                                         UID: ATU64260999

        FB-Nr.: FN 309285 g          FB-Gericht: LG Korneuburg

In response to

pgsql-bugs by date

Next:From: Dimitri FontaineDate: 2010-09-24 10:30:50
Subject: Re: installer problems
Previous:From: Dave PageDate: 2010-09-24 08:01:44
Subject: Re: installer problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group