tracker issue : CF-4150733

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

Leading and trailing spaces in QueryOfQuery WHERE conditions not removed

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): e-domizil License Team / e-domizil License Team (Alexander Hass)

Created: 05/10/2016

Components: Database

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Win 2012 Server x64

Vote Count: 0

Duplicate ID:	CF-4043047

Problem Description: It looks like CF2016 compared to CF10 does no longer remove trailing and leading spaces in QueryOfQueries WHERE conditions. A normal MsSQL query works this way properly. We found an article about the old behavior https://christierney.com/2010/03/05/query-of-queries-trims-whitespace-automatically/, but no note that this has changed in CF2016. So it could be a bug in CF2016.

Steps to Reproduce:

<cfset qData = QueryNew("id,code,description","Integer,Varchar,Varchar",[{id=1,code="RI",description="Without spaces"},{id=2,code="RI",description="Without spaces"},{id=3,code="RI    ",description="With 4 spaces"}]) />

<cfquery name="qWithoutSpaces" dbtype="query">
        select *
        from qData
        where code = 'RI'
</cfquery>

<cfquery name="qWithSpaces" dbtype="query">
        select *
        from qData
        where code = 'RI    '
</cfquery>

<cfdump var="#qData#" label="qData" />
<cfdump var="#qWithoutSpaces#" label="Without spaces" />
<cfdump var="#qWithSpaces#" label="With spaces" />


Actual Result: Does not work as CF10

Expected Result: Work as before or "new" design?

Any Workarounds: Manual trim

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

Watson Bug ID:	4150733

External Customer Info:
External Company:  
External Customer Name: Firstname Lastname
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

  1. May 10, 2016 00:00:00: 1_CF10_DUMP.png
  2. May 10, 2016 00:00:00: 2_CF2016_DUMP.png
  3. May 10, 2016 00:00:00: 3_cf2016_queryofquery.cfm

Comments:

Screenshots attached with dumps
Comment by External U.
2884 | May 10, 2016 05:34:24 AM GMT
At https://support.microsoft.com/en-us/kb/316626 you can find additional info how MSSQL compare strings.
Comment by External U.
2885 | May 10, 2016 05:38:53 AM GMT
There is a jvm flag to revert to older behaviour of honoring the spaces. -Dcoldfusion.trim.dbresult=true This bug is duplicate of bug #CF-4043047, so I am withdrawing it as duplicate.
Comment by Nimit S.
2886 | May 16, 2016 02:17:19 AM GMT