Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Tim Mixell / Tim Mixell (Tim Mixell)
Created: 02/20/2015
Components: Database
Versions: 11.0
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: CF11_Final / CF11 Update7
Priority/Frequency: Trivial / Unknown
Locale/System: English / Windows 7 64-bit
Vote Count: 9
Related Bugs:
CF-3944215 - Similar to
CF-3949417 - Similar to
Problem Description: When using named parameters within queryExecute, a parameter that is the substring of another parameter is incorrectly being inserted in the statement where the latter exists.
Steps to Reproduce:
Two parameters declared within a query - :param and :param2 result in the following:
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "2" at line 1, column 48.
queryExecute(
"SELECT * FROM art WHERE artID > :param AND artID < :param2",
{ param: { value: 1, cfsqltype: "cf_sql_integer" },
param2: { value: 10, cfsqltype: "cf_sql_integer" }
},
{ datasource: "cfartgallery" }
);
Expected Result: Named parameters shouldn't do this!
Any Workarounds: Updating the name of the first param so that it is no longer a substring of the second appears to resolve the issue:
queryExecute(
"SELECT * FROM art WHERE artID > :param1 AND artID < :param2",
{ param1: { value: 1, cfsqltype: "cf_sql_integer" },
param2: { value: 10, cfsqltype: "cf_sql_integer" }
},
{ datasource: "cfartgallery" }
);
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3943345
External Customer Info:
External Company:
External Customer Name: Tim
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: