tracker issue : CF-4100830

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

Query of queries results

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Anthony Siciliano / Anthony Siciliano (Anthony Siciliano)

Created: 12/16/2015

Components: Database

Versions: 11.0

Failure Type: Data Corruption

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Win 2008 Server x64

Vote Count: 0

Duplicate ID:	CF-4043047

Problem Description:  Change in results from cf9 to cf11

<!--- char field selection --->
<cfquery name="test1" datasource="any">
    select 
        CAST('HS' as char(4)) as locationID
</cfquery>
<cfdump var="#test1#">

<hr>the following will return results in CF9, but not CF11<hr>
<cfquery name="queryOfTest1" dbtype="query">
    select locationID
    from test1
    where locationID = 'HS'
</cfquery>
<cfdump var="#queryOfTest1#">


is there a configuration option to change back to CF9 char field behavior

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4100830

External Customer Info:
External Company:  
External Customer Name: Anthony Siciliano
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Side note... The obvious fix is not use char... but there are thousands of these in the application and cannot be changed in time.
Comment by External U.
5045 | December 16, 2015 03:13:55 PM GMT
I would argue against "fixing" this. Char fields should not automatically trim trailing spaces. Anthony might want it to, but I would imagine many others would not want that to happen. That's what varchar is for. In fact, I'd almost bet the automatic trimming (or failure to retain) trailing spaces on char fields was a previous bug that is actually fixed in ColdFusion 11.
Comment by External U.
5046 | December 16, 2015 09:47:36 PM GMT
Anthony, This issue is fixed as part of ColdFusion 11 Update 7. We have introduced new jvm flag to revert to old behaviour of honoring the spaces. -Dcoldfusion.trim.dbresult=true Please let me know if this resolve your problem.
Comment by Nimit S.
5047 | December 16, 2015 11:48:47 PM GMT
This option works and is exactly what I needed. I agree this is not the correct way, but with the legacy application, it will allow me to upgrade and fix in a more efficient and timely manner.
Comment by External U.
5048 | December 17, 2015 09:13:03 AM GMT