Repair faulty plan generation in cases where we choose to implement an
authorTom Lane <[email protected]>
Sun, 18 Jan 2004 00:31:53 +0000 (00:31 +0000)
committerTom Lane <[email protected]>
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 5b915c2109cbd359baa0c1a1369fe5ef59e4eb91..ecd3b7116081ea5d69e6f2f635a934eba0a12ab3 100644 (file)
@@ -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);