tracker issue : CF-3041845

select a category, or use search below
(searches all categories and all time range)
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 Tracker

Status/Resolution/Reason: Closed/Won't Fix/

Reporter/Name(from Bugbase): Jia ZHU / Jia ZHU (n3p3nth3)

Created: 08/02/2010

Components: Database, CFQuery

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,0,251028 /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

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: