Обсуждение: pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used

Поиск
Список
Период
Сортировка

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

От
tgl@postgresql.org (Tom Lane)
Дата:
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)