pgsql: Fix assertion failure when a SELECT DISTINCT ON expression is

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix assertion failure when a SELECT DISTINCT ON expression is
Дата
Msg-id 20090912000459.46D8F753FB7@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/optimizer/path:
        equivclass.c (r1.19 -> r1.20)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/equivclass.c?r1=1.19&r2=1.20)
        pathkeys.c (r1.98 -> r1.99)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/pathkeys.c?r1=1.98&r2=1.99)
    pgsql/src/test/regress/expected:
        select_distinct_on.out (r1.5 -> r1.6)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/select_distinct_on.out?r1=1.5&r2=1.6)
    pgsql/src/test/regress/sql:
        select_distinct_on.sql (r1.4 -> r1.5)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/select_distinct_on.sql?r1=1.4&r2=1.5)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Increase the maximum value of extra_float_digits to 3, and have
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix assertion failure when a SELECT DISTINCT ON expression is