Status/Resolution/Reason: Closed/Withdrawn/AsDesigned
Reporter/Name(from Bugbase): Mosh Teitelbaum / Mosh Teitelbaum ()
Created: 02/28/2017
Components: Language
Versions: 2016
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2016.0.03.300466 /
Priority/Frequency: Normal / All users will encounter
Locale/System: ALL / Windows 10 64 bit
Vote Count: 0
Problem Description:
When creating a struct key and trying to use the value from a query as the key, not escaping the queryname.columnname returns an unexpected result. Instead of the value of the query column, it sets a nested struct as the key value.
Steps to Reproduce:
{code}
<cfset qry = queryNew("name,age", "varchar,Integer", [
{"name" : "Bob", "age" : 25}
]) />
<!--- This produces odd results --->
<cfset str1 =
{ qry.age : qry.name }
/>
<cfdump var="#str1#" />
<!--- This produces expected results --->
<cfset str2 =
{ "#qry.age#" : qry.name }
/>
<cfdump var="#str2#" />
{code}
Actual Result:
See screenshot for results.
Expected Result:
Both methods should produce a a struct with a key whose name comes from the query column.
Any Workarounds:
Escape the query.column reference.
Attachments:
- February 28, 2017 00:00:00: cf_error.png
Comments: