Commit 5da466c5 authored by Tom Lane's avatar Tom Lane

Make sure targetlist generated for subplan does not share

nodes with HAVING qualifier of upper plan.  Have not seen any failures,
just being a little bit paranoid...
parent b6c732e6
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.48 1999/05/03 00:38:43 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.49 1999/05/04 00:00:20 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -505,8 +505,13 @@ make_subplanTargetList(Query *parse, ...@@ -505,8 +505,13 @@ make_subplanTargetList(Query *parse,
if (tlist_member(v, sub_tlist) == NULL) if (tlist_member(v, sub_tlist) == NULL)
{ {
/* Make sure sub_tlist element is a fresh object not shared with
* any other structure; not sure if anything will break if it is
* shared, but better to be safe...
*/
sub_tlist = lappend(sub_tlist, sub_tlist = lappend(sub_tlist,
create_tl_element(v, next_resno)); create_tl_element((Var *) copyObject(v),
next_resno));
next_resno++; next_resno++;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment