I would say it's a bug as I can verify this on my local CFMX7 server. It
seems that if you have a DML statement i.e. delete,update or insert and you
have named that query and if you do a select query afterwards with the same
query name, CF copies the name to the variables scope. Really strange.

Thanks,

On 8/17/06, Andy Allan <[EMAIL PROTECTED]> wrote:
>
> http://www.adobe.com/go/wish
>
> On 17/08/06, Russ <[EMAIL PROTECTED]> wrote:
> > So how would I go about submitting this to macrodobe?
> >
> > > -----Original Message-----
> > > From: Ben Nadel [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, August 16, 2006 5:48 PM
> > > To: CF-Talk
> > > Subject: RE: ColdFusion var bug?
> > >
> > > Russ,
> > >
> > > That looks like a bug to me.
> > >
> > > .......................
> > > Ben Nadel
> > > www.bennadel.com
> > >
> > > -----Original Message-----
> > > From: Russ [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, August 16, 2006 5:33 PM
> > > To: CF-Talk
> > > Subject: ColdFusion var bug?
> > >
> > > Looks like I found a bug in coldfusion in regards to varing variables
> in a
> > > cfc.  Here is the example code to reproduce.
> > >
> > >
> > >
> > >             <cffunction name="method1">
> > >
> > >                   <cfset var myQryTest="">
> > >
> > >
> > >
> > >                   <cfquery name="myQryTest"
> > > datasource="#application.mydsn#">
> > >
> > >                         DELETE FROM  table
> > >
> > >                         WHERE tableid=-1
> > >
> > >                   </cfquery>
> > >
> > >
> > >
> > >                   <cfquery name="myQryTest"
> > > datasource="#application.mydsn#">
> > >
> > >                         select tableid from users where tableid=1
> > >
> > >                   </cfquery>
> > >
> > >             </cffunction>
> > >
> > >             <cffunction name="method2">
> > >
> > >                   <cfdump var="#myQryTest#">
> > >
> > >             </cffunction>
> > >
> > >
> > >
> > >
> > >
> > > Then run this on a test page.
> > >
> > > <cfobject name="application.mycomponent" component="mycomponent">
> > >
> > > <cfinvoke component="#application.mycomponent #" method="method1">
> > >
> > > <cfinvoke component="#application mycomponent #" method="method2">
> > >
> > >
> > >
> > > If you've set everything up right, you'll see a dump of a query.  In
> > > reality
> > > you should be getting an exception.
> > >
> > >
> > >
> > >
> > >
> > > I think what happens is when the first query runs, it deletes the
> > > variable,
> > > since it doesn't return anything.  When the second select query runs,
> it
> > > recreates the variable as a regular variable which is local to the
> cfc,
> > > not
> > > the function.
> > >
> > >
> > >
> > > Is this a CF bug?  I got around it by creating a local struct and then
> > > putting those variables into that struct, but in general, this is not
> > > intended behaviour, correct?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Russ
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250163
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to