Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 02/25/2016
Components: Documentation
Versions: 2016
Failure Type: Unspecified
Found In Build/Fixed In Build: CF2016_Final /
Priority/Frequency: Trivial / Few users will encounter
Locale/System: English / Platforms All
Vote Count: 0
https://helpx.adobe.com/coldfusion/developing-applications/accessing-and-using-data/using-query-of-queries/query-of-queries-user-guide.html says:
--------------------------------------------
Passing queries by reference
A Query of Queries is copied by reference from its related query; which means that ColdFusion does not create a query when you create a Query of Queries. It also means that changes to a Query of Queries, such as ordering, modifying, and deleting data, are also applied to the base query object.
If you do not want the original query to change, use the Duplicate function to create a copy and create the Query of Queries using the copied query.
--------------------------------------------
That is not true. In a QoQ, the source query is copied by value. Repro:
<cfscript>
q1 = queryExecute("SELECT artName FROM art WHERE artID <= 3", [], {datasource="cfartgallery"});
q2 = queryExecute("SELECT artName FROM q1 ORDER BY artName", [], {dbtype="query"});
q3 = queryExecute("SELECT artName FROM q2", [], {dbtype="query", maxrows=1});
querySetCell(q3, "artName", "Foobar", 1);
writeDump(q1);
writeDump(q2);
writeDump(q3);
</cfscript>
Actual and expected result: The queries were copied by value (good). Confirmed in CF11 Update 7 and CF2016.
Thus, that entire "Passing queries by reference" section should be removed from the docs.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4121945
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: