Обсуждение: pgsql: Fix a couple of planner bugs introduced by the new ability to
pgsql: Fix a couple of planner bugs introduced by the new ability to
От
tgl@postgresql.org (Tom Lane)
Дата:
Log Message: ----------- Fix a couple of planner bugs introduced by the new ability to discard ORDER BY <constant> as redundant. One is that this means query_planner() has to canonicalize pathkeys even when the query jointree is empty; the canonicalization was always a no-op in such cases before, but no more. Also, we have to guard against thinking that a set-returning function is "constant" for this purpose. Add a couple of regression tests for these evidently under-tested cases. Per report from Greg Stark and subsequent experimentation. Modified Files: -------------- pgsql/src/backend/optimizer/path: equivclass.c (r1.2 -> r1.3) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/equivclass.c.diff?r1=1.2&r2=1.3) pgsql/src/backend/optimizer/plan: planmain.c (r1.101 -> r1.102) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planmain.c.diff?r1=1.101&r2=1.102) pgsql/src/test/regress/expected: select.out (r1.17 -> r1.18) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/select.out.diff?r1=1.17&r2=1.18) pgsql/src/test/regress/sql: select.sql (r1.13 -> r1.14) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/select.sql.diff?r1=1.13&r2=1.14)