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 20070718214122.744679FBF66@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_1_STABLE

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

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c.diff?r1=1.100.2.3&r2=1.100.2.4)
    pgsql/src/test/regress/expected:
        subselect.out (r1.13.2.1 -> r1.13.2.2)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/subselect.out.diff?r1=1.13.2.1&r2=1.13.2.2)
    pgsql/src/test/regress/sql:
        subselect.sql (r1.8.2.1 -> r1.8.2.2)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/subselect.sql.diff?r1=1.8.2.1&r2=1.8.2.2)

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: Bruce Momjian
Date:
Subject: Re: pgsql: Document that age() adds days, then full months.