• timour@mysql.com's avatar
    Fix for BUG#14920 Ordering aggregated result sets corrupts resultset. · 999a73ac
    timour@mysql.com authored
    The cause of the bug was the use of end_write_group instead of end_write
    in the case when ORDER BY required a temporary table, which didn't take
    into account the fact that loose index scan already computes the result
    of MIN/MAX aggregate functions (and performs grouping).
    
    The solution is to call end_write instead of end_write_group and to add
    the MIN/MAX functions to the list of regular functions so that their
    values are inserted into the temporary table.
    999a73ac
group_min_max.test 40.4 KB