• timour@mysql.com's avatar
    Fix for BUG#16710. · eed7cf09
    timour@mysql.com authored
    The bug was due to a missed case in the detection of whether an index
    can be used for loose scan. More precisely, the range optimizer chose
    to use loose index scan for queries for which the condition(s) over
    an index key part could not be pushed to the index together with the
    loose scan.
    
    As a result, loose index scan was selecting the first row in the
    index with a given GROUP BY prefix, and was applying the WHERE
    clause after that, while it should have inspected all rows with
    the given prefix, and apply the WHERE clause to all of them.
    
    The fix detects and skips such cases.
    eed7cf09
item.h 75 KB