Bug #35662 5.0 coalesce returns varbinary for dates on Windows
Submitted: 28 Mar 2008 22:44 Modified: 31 Mar 2008 17:41
Reporter: Patrick Crews Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Types Severity:S2 (Serious)
Version:5.0 OS:Windows (XP 32bit (tested))
Assigned to: CPU Architecture:Any
Tags: 5.0, COALESCE, date data type, varbinary, windows

[28 Mar 2008 22:44] Patrick Crews
Description:
COALESCE(date, date) returns varbinary on 5.0.51a for Windows XP 32bit (only tested this flavor)

COALESCE(date,date) returns date on Mac OS

This appears to be related to Bug#27216 - coalesce returns varbinary for dates
http://bugs.mysql.com/bug.php?id=27216

Problem does not seem to appear in Non-Windows flavors and is not visible on 5.1.23 for XP (did not test 4.1)

How to repeat:
# Create the table t2:
create table t1 (f1 date, f2 datetime, f3 varchar(20));
create table t2 as select coalesce(f1,f1) as f4 from t1;
show create table t2;

#ENGINE may vary depending on Windows install choices, but appears with InnoDB or MyISAM
CREATE TABLE `t2` (
  `f4` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Suggested fix:
Make 5.0.51 for Windows return DATE type on COALESCE(date,date).

This would be in agreement with the behavior of 5.1.23 for Windows as well as other OS' versions of 5.0
[31 Mar 2008 17:41] Omer Barnir
The bug was fixed in 5.0.52 and was not observed when testing 5.0.56 - closing