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

pgsql: While doing the final setrefs.c pass over a plan tree, try to

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: While doing the final setrefs.c pass over a plan tree, try to
Date: 2009-11-16 18:04:41
Message-ID: 20091116180441.0C360753FB7@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
While doing the final setrefs.c pass over a plan tree, try to match up
non-Var sort/group expressions using ressortgroupref labels instead of
depending entirely on equal()-ity of the upper node's tlist expressions
to the lower node's.  This avoids emitting the wrong outputs in cases
where there are textually identical volatile sort/group expressions,
as for example
	select distinct random(),random() from generate_series(1,10);
Per report from Andrew Gierth.

Backpatch to 8.4.  Arguably this is wrong all the way back, but the only known
case where there's an observable problem is when using hash aggregation to
implement DISTINCT, which is new as of 8.4.  So for the moment I'll refrain
from backpatching further.

Modified Files:
--------------
    pgsql/src/backend/optimizer/plan:
        setrefs.c (r1.154 -> r1.155)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/setrefs.c?r1=1.154&r2=1.155)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-11-16 18:04:47
Subject: pgsql: While doing the final setrefs.c pass over a plan tree, try to
Previous:From: Peter EisentrautDate: 2009-11-16 17:05:10
Subject: Re: [HACKERS] pgsql: /home/peter/commit-msg

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