• Alexey Kopytov's avatar
    Bug #48472: Loose index scan inappropriately chosen for some · 7f2ba28e
    Alexey Kopytov authored
                WHERE conditions 
     
    check_group_min_max() checks if the loose index scan 
    optimization is applicable for a given WHERE condition, that is 
    if the MIN/MAX attribute participates only in range predicates 
    comparing the corresponding field with constants. 
     
    The problem was that it considered the whole predicate suitable 
    for the loose index scan optimization as soon as it encountered 
    a constant as a predicate argument. This is obviously wrong for 
    cases when a constant is the first argument of a predicate 
    which does not satisfy the above condition. 
     
    Fixed check_group_min_max() so that all arguments of the input 
    predicate are considered to decide if it passes the test, even 
    though a constant has already been encountered.
    7f2ba28e
opt_range.cc 303 KB