• unknown's avatar
    Fix LP BUG#680846 · 6dfca7d3
    unknown authored
    Analysis:
    JOIN::optimize performs constant optimization of GROUP by clauses
    by calling remove_const():
        group_list= remove_const(this, (old_group_list= group_list), conds,
                                 rollup.state == ROLLUP::STATE_NONE,
    			     &simple_group);
    If it turns out that a GROUP clause references a field that is
    computed by a single-row subquery, then the said optimization
    performs premature execution of the subquery referenced by the
    group clause.
    
    Solution:
    Block the evaluation of subqueries similarly to the approach
    for the WHERE and JOIN..ON clauses.
    6dfca7d3
sql_select.cc 628 KB