Skip to content

Commit 4756ff3

Browse files
committed
Put back copyObject() call I removed in a fit of brain fade. This one
is still needed despite cleanups in setrefs.c, because the point is to let the inserted Result node compute a different tlist than its input node does. Per example from Jeremy Drake.
1 parent 7395c76 commit 4756ff3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/optimizer/plan/createplan.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.226 2007/02/22 22:00:24 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.227 2007/02/25 17:44:01 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -2740,7 +2740,11 @@ make_sort_from_pathkeys(PlannerInfo *root, Plan *lefttree, List *pathkeys)
27402740
* Do we need to insert a Result node?
27412741
*/
27422742
if (!is_projection_capable_plan(lefttree))
2743+
{
2744+
/* copy needed so we don't modify input's tlist below */
2745+
tlist = copyObject(tlist);
27432746
lefttree = (Plan *) make_result(root, tlist, NULL, lefttree);
2747+
}
27442748

27452749
/*
27462750
* Add resjunk entry to input's tlist

0 commit comments

Comments
 (0)