Title:
Bug 83732:When using single-quoted empty strings in a SQL statement using the new CFScript syntax, the addParam leads to an error
| View in TrackerProblem:
When using single-quoted empty strings in a SQL statement using the new CFScript syntax, the addParam leads to an error.This is because of the way the function replaceDelimsWithMarkers in CustomTags/com/adobe/coldfusion/query.cfc works - it splits the statement by single quote using listtoarray, and only processes even numbered elements, which is *supposed* to be the single quoted content.BUT, in case of empty string, ListToArray ignore the empty fields (empty strings) by default, this screws up the content interpretation.All it takes to fix it is to use the attribute "includeEmptyFields" in the call of ListToArray function in CustomTags/com/adobe/coldfusion/query.cfc.Line 345, changevar sqlArray = listtoarray(arguments.sql,"'");tovar sqlArray = listtoarray(arguments.sql,"'", true, false); This way empty content is not ignored.
Method:
Result:
When using single-quoted empty strings in a SQL statement using the new CFScript syntax, the addParam leads to an error.This is because of the way the function replaceDelimsWithMarkers in CustomTags/com/adobe/coldfusion/query.cfc works - it splits the statement by single quote using listtoarray, and only processes even numbered elements, which is *supposed* to be the single quoted content.BUT, in case of empty string, ListToArray ignore the empty fields (empty strings) by default, this screws up the content interpretation.All it takes to fix it is to use the attribute "includeEmptyFields" in the call of ListToArray function in CustomTags/com/adobe/coldfusion/query.cfc.Line 345, changevar sqlArray = listtoarray(arguments.sql,"'");tovar sqlArray = listtoarray(arguments.sql,"'", true, false); This way empty content is not ignored.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041845
External Customer Info:
External Company:
External Customer Name: Jia ZHU
External Customer Email: 2B0A1DC7462E0311992015A8
External Test Config: 08/02/2010
Attachments:
Comments: