tracker issue : CF-3769705

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

Having one single quote in a multi-line style comment in a script based query breaks params.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Chris Phillips / Chris Phillips (cf_chris)

Created: 06/02/2014

Components: Database

Versions: 10.0

Failure Type: Crash

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

DESCRIPTION:
Problem Description:
If you write "multi-line" style comment in the sql of a script based query that includes a single single-quote, it will break the parameters that follow it.

Steps to Reproduce:
Write a query in the style of "var q = new Query(...)". 
Include a multiline comment in the SQL like "/* Don't include inactive things */" before one of the "colon-params" (e.g. tbl.Active = :Active). 
Run it. 
See error.

Actual Result:
[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ':'

Expected Result:
The query runs and returns a recordset. This is the actual result for <cfquery>. It is broken for Query.cfc.

Any Workarounds:
Avoid informative comments in your code if you choose to write script components.

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

Watson Bug ID:	3769705

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

Windows 7 (SP1) 64-bit

ColdFusion 10 - 10,0,12,286680

Java Version - 1.7.0_17

Attachments:

  1. June 03, 2014 00:00:00: 1_QueryObjectFail.cfm

Comments:

I think it is worth noting that this works as expected in Railo 4.1.2.005 final
Comment by External U.
12013 | June 02, 2014 07:22:39 PM GMT
QueryExecute() function has been introduced in ColdFusion 11 which addresses this issue.
Comment by Nimit S.
12014 | August 13, 2014 01:49:45 AM GMT