Thread: 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
From
tgl@postgresql.org (Tom Lane)
Date:
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)