Title:
Bug 80629:A date value returned from a MySQL query using the GREATEST() function, is seen by CF9 as a binary value
| View in TrackerStatus/Resolution/Reason: Closed/Won't Fix/
Reporter/Name(from Bugbase): Julian Halliwell / Julian Halliwell (cfSimplicity)
Created: 11/10/2009
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,251028 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 3
Problem:
A date value returned from a MySQL query using the GREATEST() function, is seen by CF9 as a binary value. CF8 (or the drivers that shipped with it) correctly interpreted this as a date.Workaround: Use the ToString() CF function on the binary value.
Method:
1) In MySQL 5.0.45, create the following table:CREATE TABLE `persons` (`ID` int(11) unsigned NOT NULL,`dateCreated` datetime default NULL,`dateUpdated` datetime default NULL,PRIMARY KEY (`ID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;INSERT INTO `persons` VALUES ('1','2009-11-05 05:02:38','2009-11-09 16:18:17');2) Excecute the follow CFML<cfquery name="q" datasource="mysqldsn">SELECTGREATEST( dateUpdated,dateCreated )AS dateLastChangeFROMpersons</cfquery><cfdump var="#q#"><cfoutput query="q">#DateFormat( dateLastChange, "yyyymmdd" )#</cfoutput>
Result:
The value class [B cannot be converted to a date.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040397
External Customer Info:
External Company:
External Customer Name: Julian Halliwell
External Customer Email: 2D5C74634456F5BE992016E5
External Test Config: 11/10/2009
Attachments:
Comments: