• Tom Lane's avatar
    Fix an old thinko in SS_make_initplan_from_plan, which is used when optimizing · d514ea3f
    Tom Lane authored
    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.
    d514ea3f
subselect.out 11 KB