tracker issue : CF-4119914

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

CF 11 Update 7 appears ignoring wildcard in query

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/UserError

Reporter/Name(from Bugbase): Brian Coyne / Brian Coyne (Brian Coyne)

Created: 02/19/2016

Components: Database

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Issue: It appears that cfquery is ignoring the % in my sql query- The query works as expected in sql mgm studio and as expected in CF 9-

See attachment of how the output is on 9 vs 11 


Below is what i posted on the Adobe Forum: they recommended i submit a bug 


Good morning everyone! I am in the process of testing out my code after upgrade from CF 9 to CF 11 update 7, so far things are going quite well except for one feature that was not built by me for our intranet page- The feature is a quick search button that allows users to type and get auto suggest options- For example typing Form would bring up anything in out links database that has the word form in it. This works perfectly on CF9, on CF11 it works ( no errors) except for the query only pulls based on the first letter typed  For Example previously I could type Interview and I would get multiple results with the word interview in it, now i type and i only get results that start with matching letters. Below is a screen show that may make more sense as well as part of our code- I have verfied in SQL mgm studio that the query outputs the correct information- I also ran code analyzer on this page and it came back with no issues
 
Also during the upgrade i exported the .car file from cf 9 into cf 11 so the settings should be the same- also like i said before it is not throwing errors- it works- just not with the fully correct results- my apologies if the code is not up to par- like i said i didn't write this!

CODE OUTPUT of CFC File
 
<cfcomponent>
<cfset ds="IntranetLinks">
<!--- Function to get the web pages from the database. Used for the Auto-Suggest --->
<cffunction name="lookupLink"
  access="remote"
  returntype="String"
  hint="Lookup method for Ajax auto-suggest">
  <cfargument name="search"
  type="any"
  required="false"
  default="">
<cfset var data="">
 
 
<cfquery datasource="#ds#" name="data">
SELECT PageName
FROM dbo.links
WHERE UPPER(PageName) LIKE UPPER('%#ARGUMENTS.search#%')
ORDER BY PageName
</cfquery>
 
<cfreturn ValueList(data.PageName)>
 
</cffunction>
<!--- Function to get the URL from the database. Populates the hidden text box on the page and used in Javascript to go to the uRL --->
<cffunction name="GetURL"
  access="remote"
  returntype="String"
  hint="Gets URL of Page - used for binding">
  <cfargument name="search"
  type="any"
  required="false"
  default="">
<cfset var data="">
 
 
<cfquery datasource="#ds#" name="data">
SELECT URL, PageName
FROM dbo.links
WHERE UPPER(PageName) LIKE UPPER('%#ARGUMENTS.search#%')
ORDER BY URL
</cfquery>
 
<cfreturn data.URL>
</cffunction>
 
</cfcomponent>

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

Watson Bug ID:	4119914

External Customer Info:
External Company:  
External Customer Name: Brian Coyne
External Customer Email:  
External Test Config: CF 11 update 7

Server 2012 R2

Attachments:

  1. February 19, 2016 00:00:00: 1_Cf9-11.PNG

Comments:

Brian, Please provide the information mentioned below: 1. Both CF9 and CF11U7 are pointing to the same database server. 2. Execute the code given below on the both CF servers and share the output details <cfquery datasource="#ds#" name="data"> SELECT PageName FROM dbo.links WHERE UPPER(PageName) LIKE UPPER('%#ARGUMENTS.search#%') ORDER BY PageName </cfquery> NOTE: Please remove the dependencies from the code snippet, then execute it.
Comment by Nimit S.
4583 | February 22, 2016 05:13:32 AM GMT
They are pointing to the same database If i use this code to simulate the query in my page : <cfquery datasource="Links" name="data"> SELECT PageName FROM dbo.IntranetUpdated WHERE UPPER(PageName) LIKE UPPER('%Form%') ORDER BY PageName </cfquery> <cfoutput query="data" > #PageName# </cfoutput> I get an output of : Risk Downtime Form 2015 Plan Information 901 Upgrade Information Appeal Form Authorization for Disclosure of Protected Health Information Benefits Information CarePoints Information Drug Information Service Emergency Department Forms Employee Mammogram Form ESA REMS Form Exit Interview Information Exposure Forms Non-Associate FDA MedWatch Voluntary Reporting Form Health Information Release Form Hospital Forms Hospital Formulary - Formulary Kronos System Access Form Leave/Disability Information For Employees Non-Grandfathered Healthcare Reform Preventive Services Order Form - Administrative Order Form - Clinical Order Form - Physical Therapy Order Uniforms Performance Manager Pt Relations Downtime Form Registration Information Resident City Tax Form Scheduling Change Form Scheduling Encumbrance Form Seidman Forms Standards of Performance W9 Form This is correct as these are all the documents with the word form in it- If i go back to the page that uses arguments.search and type the word form- i get no results So this leads me to believe it is not the wildcards-but possible the arguements.search
Comment by External U.
4584 | February 24, 2016 09:16:51 AM GMT
I have tried the same thing at my end and it is working fine. Did you try "form-" or "form -", because the content which you have shown in the previous comment, it does not have anything matching "form-"? Can you please check it one more time?
Comment by Nimit S.
4585 | March 11, 2016 03:52:22 AM GMT
Brian, Can you please check as I mentioned in my previous comment? Please let us know if it works.
Comment by Nimit S.
4586 | April 11, 2016 06:10:09 AM GMT
We were able to resolve this by enabling Match Contains True for the cfinput field. Not sure why we never needed this in CF9, but that did the trick
Comment by External U.
4587 | April 11, 2016 06:16:13 AM GMT
Thanks Brian for the confirmation. We will be closing this bug.
Comment by Nimit S.
4588 | April 11, 2016 09:54:35 AM GMT