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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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)

Browse pgsql-committers by date

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