]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Repair faulty plan generation in cases where we choose to implement an
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 18 Jan 2004 00:31:53 +0000 (00:31 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 18 Jan 2004 00:31:53 +0000 (00:31 +0000)
IN clause by mergejoin, and a type coercion is needed just above the subplan.
A more extensive patch will follow in HEAD.

src/backend/optimizer/plan/createplan.c

index 08db46c942ac242c771d94251c55923bc63646b7..54827a99fa519603d585a95efc9f4859d106334b 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.157.2.1 2003/11/25 19:17:16 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.157.2.2 2004/01/18 00:31:53 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1865,10 +1865,10 @@ make_sort_from_pathkeys(Query *root, Plan *lefttree,
                        /*
                         * Do we need to insert a Result node?
                         *
-                        * Currently, the only non-projection-capable plan type we can
-                        * see here is Append.
+                        * Currently, the only non-projection-capable plan types we can
+                        * see here are Append and Unique.
                         */
-                       if (IsA(lefttree, Append))
+                       if (IsA(lefttree, Append) || IsA(lefttree, Unique))
                        {
                                tlist = copyObject(tlist);
                                lefttree = (Plan *) make_result(tlist, NULL, lefttree);