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.
Showing
- src/backend/optimizer/path/equivclass.c 9 additions, 7 deletionssrc/backend/optimizer/path/equivclass.c
- src/backend/optimizer/plan/planmain.c 13 additions, 1 deletionsrc/backend/optimizer/plan/planmain.c
- src/test/regress/expected/select.out 32 additions, 0 deletionssrc/test/regress/expected/select.out
- src/test/regress/sql/select.sql 16 additions, 0 deletionssrc/test/regress/sql/select.sql
Loading
Please register or sign in to comment