Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce
Reporter/Name(from Bugbase): / ext-user (Md. Kaif Akbar Quraishi)
Created: 07/22/2013
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: 10 /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Linux Red Hat All,Win All
Vote Count: 0
Problem:
CFM Application using Cfquery using CONCAT() without CAST is not working in CF 10 server whereas same application was working perfectly in CF7.
-------
<cfquery name="VARIABLES.qTestSELECT1" datasource="#APPLICATION.dsn#">
SELECT opened_by, CONCAT(date_opened, ' ', open_time) AS testField
FROM test.inquiry
LIMIT 10
</cfquery>
---------------
Method:
Executing Below code will give this result:-
---------------------------------------------------------
<html>
<head>
<title>Test page</title>
</head>
<cfset APPLICATION.dsn = 'test_other'>
DSN is <cfdump var="#APPLICATION.dsn#">
<br />Using CAST works, but would require multiple changes:<br />
<cfquery name="VARIABLES.qTestSELECT0" datasource="#APPLICATION.dsn#">
SELECT opened_by, CAST(CONCAT(date_opened, ' ', open_time) AS datetime) AS castTestField
FROM test.inquiry
LIMIT 10
</cfquery>
<cfloop query="VARIABLES.qTestSELECT0">
<cfoutput>#VARIABLES.qTestSELECT0.castTestField#</cfoutput>
<br />
</cfloop>
<br />Without CAST, tostring or [0]:<br />
<cfquery name="VARIABLES.qTestSELECT1" datasource="#APPLICATION.dsn#">
SELECT opened_by, CONCAT(date_opened, ' ', open_time) AS testField
FROM test.inquiry
LIMIT 10
</cfquery>
<cfloop query="VARIABLES.qTestSELECT1">
<cfoutput>#VARIABLES.qTestSELECT1.testField#</cfoutput>
</cfloop>
</body>
</html>
---------------------------------------------------------
Result:
Giving "ByteArray Objects conversion to Strings" error.
Expected:
As cfquery code without CAST was was working working in CF 7 so it should also work in CF 10.
Workaround:
Client needs workaround for this issue at application/datasource level, not for coding level workaround as CASTING at coding level is not feasible for them due to this kind of code being used several hundred times.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3599250
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: