Affects Version/s: None
Fix Version/s: None
Component/s: Query Processor
From the Wiki:
"Otherwise, the operator is probably a UDF/UDAF function. In that case, we will try to convert the parameters to the types that are accepted by the UDF/UDAF function. If the UDF/UDAF function is overloaded (with more than 1 implementations with different types), we will try to find the one with least number of type conversions needed."
SELECT SUM(thing=otherthing) FROM table
...fails, because thing=otherthing is a bool, and there is no system by which BOOL would convert to INT, as it should. INT is higher precision, so this should always work. Explicit casting, SUM(CAST(thing=otherthing AS INT)) works just fine.
(yes, in this simple case COUNT(1) WHERE thing=otherthing would do the job, but it serves to illustrate the bug.)