Title:
Bug 79382:When you have a cfquery that within its body calls any cffunction that itself runs a cfquery, the containing cfquery will use the function’s query’s datasource and ignore the one passed to it as an at
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)
Created: 08/11/2009
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 259360
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Problem:
When you have a cfquery that within its body calls any cffunction that itself runs a cfquery, the containing cfquery will use the function’s query’s datasource and ignore the one passed to it as an attribute.This can cause various problems, specifically in applications and systems that leverage more than one datasource, one of ColdFusion's biggest claim to fame ( its ability to connect to diverse and disparate non-ColdFusion systems seamlessly. The following code will produce the error: Table ’ds2DatabaseName.tableInDS1’ doesn’t exist The query in the f function will execute correctly but the q1 query will be sent through the ds2 datasource ( the bug ).--------------------------------------------------------------------------------------------<cfquery name="q1" datasource="ds1">select * from tableInDS1<cfset f( ) />where 1 = 1</cfquery><cffunction name="f"><cfquery name="q2" datasource="ds2">select * from tableInDS2</cfquery></cffunction>
Method:
See this thread: https://prerelease.adobe.com/project/forum/thread.html?cap=87529bda13744b3db718e841890b9240&forid={a8760b70-42a5-45fc-8ba2-dfcf173a9580}&topid={f1ee42ec-446d-42e5-a616-4debe8c466c4}&tp=2&prr=0&a=added_r
Result:
Various
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3039634
External Customer Info:
External Company:
External Customer Name: David McGuigan
External Customer Email: 5E0D54C04462BF5E992016B6
External Test Config: 08/11/2009
Attachments:
Comments: