tracker issue : CF-3599250

select a category, or use search below
(searches all categories and all time range)
Title:

ByteArray Objects conversion to Strings Error

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): / ext-user (Md. Kaif Akbar Quraishi)

Created: 07/22/2013

Components: Database, CFQuery

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:

The code is working fine.
Comment by Suchika S.
14860 | October 09, 2013 07:42:10 AM GMT