pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used
Date
Msg-id 20070718214115.0A5859FBF66@postgresql.org
Whole thread Raw
List 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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/optimizer/plan:
        subselect.c (r1.112.2.1 -> r1.112.2.2)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c.diff?r1=1.112.2.1&r2=1.112.2.2)
    pgsql/src/test/regress/expected:
        subselect.out (r1.14 -> r1.14.2.1)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/subselect.out.diff?r1=1.14&r2=1.14.2.1)
    pgsql/src/test/regress/sql:
        subselect.sql (r1.9 -> r1.9.2.1)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/subselect.sql.diff?r1=1.9&r2=1.9.2.1)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used