tracker issue : CF-4000264

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

QueryExecute when ? and = in string - "Lesser number (0) of positional parameters are defined for sql query"

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Peter Boughton / Peter Boughton (Peter Boughton)

Created: 06/03/2015

Components: Database

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Platforms All

Vote Count: 1

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 06, 2017 using build 2016.0.01.298513
Problem Description:
QueryExecute has a buggy SQL parser - it thinks a URL inside a string is a positional parameter.
The presence of a question mark (?) and equals (=) is triggering the error.

Steps to Reproduce:
<cfscript>
	qry = "INSERT tablename ( colname ) VALUES ( 'page?a=b' )";
	QueryExecute( qry , [] , {datasource:'core'} );
</cfscript>

Actual Result:
Error while Parsing SQL query string.

Lesser number (0) of positional parameters are defined for sql query':' [INSERT tablename ( colname ) VALUES ( 'page?a=b' )]

Expected Result:
CF should not be looking in SQL strings for parameters!

Any Workarounds:
If there are no real params, javacast('null','') can be used instead of empty array

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

Watson Bug ID:	4000264

External Customer Info:
External Company:  
External Customer Name: Peter
External Customer Email:  
External Test Config: Occurs in u2 and u4

Attachments:

Comments:

This issue is fixed and the fix for this issue will be available as part of next major release of ColdFusion.
Comment by Nimit S.
7254 | September 28, 2015 01:03:57 AM GMT
+1 ......................
Vote by External U.
7257 | September 28, 2015 01:15:55 AM GMT
Verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
7255 | August 06, 2017 07:11:46 AM GMT
So, where's the fix for this for CF 11. You're still supporting that version of the product, don't you?
Comment by Kai K.
7256 | September 14, 2017 08:13:56 PM GMT
I have also encountered this issue in CF11 Update 15. Are there any plans to rectify this in CF11?
Comment by Benjamin R.
29890 | November 02, 2018 05:49:19 AM GMT