• Monty's avatar
    Fix for MySQL bug #77448 Inconsistent handling of RAND() in WHERE and HAVING · 0ad00c66
    Monty authored
    Problem was that for queries of type:
    
    select rand() r, rand()  p, rand() = rand() from a having r = p
    
    The optimizer thought that r = p was same as rand() = rand() and this would always be true.
    
    The problem was that when testing if two expressions are equal, we didn't take into account no determinstic functions.
    
    The fix is to not compare non deterministic functions as equal.
    0ad00c66
item_func.cc 178 KB