]> granicus.if.org Git - postgresql/commit
Fix a couple of planner bugs introduced by the new ability to discard
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 7 Jul 2007 20:46:45 +0000 (20:46 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 7 Jul 2007 20:46:45 +0000 (20:46 +0000)
commit48d9d8e1318eb1d4b94d7f02a86b9e9716369947
tree74882cf6f02188ddda36ce202135d772d3e2d3e2
parentd5eaa637ce4b579a6c22c880ba9f60745526a031
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.
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/plan/planmain.c
src/test/regress/expected/select.out
src/test/regress/sql/select.sql