Title:
QueryExecute when ? and = in string - "Lesser number (0) of positional parameters are defined for sql query"
| View in TrackerStatus/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
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: