• timour/timka@lamia.home's avatar
    Fix for BUG#20954: avg(keyval) retuns 0.38 but max(keyval) returns an empty set · 86ae2f3b
    timour/timka@lamia.home authored
    The problem was in that opt_sum_query() replaced MIN/MAX functions
    with the corresponding constant found in a key, but due to imprecise
    representation of float numbers, when evaluating the where clause,
    this comparison failed.
    
    When MIN/MAX optimization detects that all tables can be removed,
    also remove all conjuncts in a where clause that refer to these
    tables. As a result of this fix, these conditions are not evaluated
    twice, and in the case of float number comparisons we do not discard
    result rows due to imprecise float representation.
    
    As a side-effect this fix also corrects an unnoticed problem in
    bug 12882.
    86ae2f3b
func_group.result 30.1 KB