• Georgi Kodinov's avatar
    Bug #45386: Wrong query result with MIN function in field list, · 1f2b5b30
    Georgi Kodinov authored
    WHERE and GROUP BY clause
    
    Loose index scan may use range conditions on the argument of 
    the MIN/MAX aggregate functions to find the beginning/end of 
    the interval that satisfies the range conditions in a single go.
    These range conditions may have open or closed minimum/maximum 
    values. When the comparison returns 0 (equal) the code should 
    check the type of the min/max values of the current interval 
    and accept or reject the row based on whether the limit is 
    open or not.
    There was a wrong composite condition on checking this and it was
    not working in all cases.
    Fixed by simplifying the conditions and reversing the logic.
    1f2b5b30
group_min_max.test 48.7 KB