Bug #910 IFNULL works only with strings and numers
Submitted: 24 Jul 2003 8:15 Modified: 27 Aug 2003 23:54
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.0-alpha OS:Microsoft Windows (Windows)
Assigned to: Bugs System CPU Architecture:Any

[24 Jul 2003 8:15] [ name withheld ]
Description:
The function IFNULL returns always a number or a string, it's not possible to use it with DATE or TIMESTAMP

How to repeat:
create table mytable (mydatefield date);

select ifnull(mydatefield,cast('2000-01-01' as date)) as ddd from mytable;

in the resultset the column ddd isn't a date (but a char)
[27 Aug 2003 23:54] Victor Vagin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html