• gkodinov/kgeorge@macbook.gmz's avatar
    Bug #15881: cast problems · a63df24a
    gkodinov/kgeorge@macbook.gmz authored
      The optimizer removes expressions from GROUP BY/DISTINCT
      if they happen to participate in a <expression> = <const>
      predicates of the WHERE clause (the idea being that if
      it's always equal to a constant it can't have multiple 
      values).
      However for predicates where the expression and the 
      constant item are of different result type this is not
      valid (e.g. a string column compared to 0).
      Fixed by additional check of the result types of the 
      expression and the constant and if they differ the 
      expression don't get removed from the group by list.
    a63df24a
distinct.test 18.3 KB