Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 10/14/2015
Components: Language
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Win XP All
Vote Count: 1
When referencing an unset query cell, CF behaves inconsistently.
These return empty string "":
1) myQuery[myCol][myIndex] returns ""
2) myRow.myCol returns "" within a for(myRow in myQuery) loop
This returns NULL:
3) myStruct.myCol returns NULL when myStruct was created via queryGetRow(myQuery, myIndex)
Steps to reproduce:
<cfscript>
q = queryNew("a,b", "", [{a="foo"}]);//leave b[1] unset
s = queryGetRow(q, 1);//convert the row to a struct
//reference b[1] in original query object
writeOutput(isNull(q.b[1]));//returns NO
writeOutput(q.b[1]);//returns ""
//reference b[1] in for(row in query)
for(row in q) {
writeOutput(isNull(row.b));//returns NO
writeOutput(row.b);//returns ""
}
//reference b[1] in new struct
writeOutput(isNull(s.b));//returns YES
writeOutput(s.b);//throws "Element b is undefined in S."
</cfscript>
Actual result: inconsistency (sometimes ""; sometimes NULL)
Expected result: consistency (referencing b[1] should behave consistently, regardless of how it's being accessed)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4073791
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
External Test Config: Verified in CF11 Update 5 (build 11,0,05,293506)
Attachments:
Comments: