pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used
Date: 2007-07-18 21:40:58
Message-ID: 20070718214058.0BC089FBF66@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix an old thinko in SS_make_initplan_from_plan, which is used when optimizing
a MIN or MAX aggregate call into an indexscan: the initplan is being made at
the current query nesting level and so we shouldn't increment query_level.
Though usually harmless, this mistake could lead to bogus "plan should not
reference subplan's variable" failures on complex queries. Per bug report
from David Sanchez i Gregori.

Modified Files:
--------------
pgsql/src/backend/optimizer/plan:
subselect.c (r1.122 -> r1.123)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c.diff?r1=1.122&r2=1.123)
pgsql/src/test/regress/expected:
subselect.out (r1.15 -> r1.16)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/subselect.out.diff?r1=1.15&r2=1.16)
pgsql/src/test/regress/sql:
subselect.sql (r1.10 -> r1.11)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/subselect.sql.diff?r1=1.10&r2=1.11)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2007-07-18 21:41:15 pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used
Previous Message Alvaro Herrera 2007-07-18 21:19:17 pgsql: Cast NULL to a pointer type in the execl() call, to avoid a