On Sep 24, 2009, at 9:23 AM, rthdavid wrote:
Quote:
3. What should Ingres do to fix it? |
Put it back the way it was. There's a debate running but I'm firmly
on the
side of reverting it to the old way.
The SQL Standard actually says that in a CASE-like expression, if any
expression is a string type, the result should be a string type.
COALESCE
and NULLIF are defined in terms of the CASE expression, and IFNULL
can be considered as a 2-expression form of COALESCE. However!
a) that's not how IFNULL is actually implemented, and b) that's not how
it used to work. It used to apply a type hierarchy that had dates
higher than
strings, so ifnull(date,string) was date.
Since IFNULL is not a standard function, I'm arguing that it should
revert
to the traditional way. CASE-based functions can operate according
to the standard. (I think the Standard's type hierarchy is blazingly
stupid,
but there you go.)
Karl