Fix assertion failure when a SELECT DISTINCT ON expression is volatile.
In this case we generate two PathKey references to the expression (one for
DISTINCT and one for ORDER BY) and they really need to refer to the same
EquivalenceClass. However get_eclass_for_sort_expr was being overly paranoid
and creating two different EC's. Correct behavior is to use the SortGroupRef
index to decide whether two references to volatile expressions that are
equal() (ie textually equivalent) should be considered the same.
Backpatch to 8.4. Possibly this should be changed in 8.3 as well, but
I'll refrain in the absence of evidence of a visible failure in that branch.
Per bug #5049.
equivclass.c (r1.19 -> r22.214.171.124)
pathkeys.c (r126.96.36.199 -> r188.8.131.52)
select_distinct_on.out (r1.5 -> r184.108.40.206)
select_distinct_on.sql (r1.4 -> r220.127.116.11)
pgsql-committers by date
|Next:||From: Peter Eisentraut||Date: 2009-09-12 15:21:28|
|Subject: pgsql: Remove TODO file; it has been added to the main Todo list in the |
|Previous:||From: Tom Lane||Date: 2009-09-12 00:04:59|
|Subject: pgsql: Fix assertion failure when a SELECT DISTINCT ON expression is |