5

I'd like to find out if there is a way to set the debug output query name using queryExecute().

    <cfscript>
    qryTest = queryExecute('SELECT * FROM art', {}, {datasource="cfartgallery"});
    writeDump(var="#qryTest#");
    </cfscript>

Generates debug output like this:

enter image description here

UPDATE for CF 11u5, the debug output replaces "_queryname_var0" with "ExecuteQuery". It looks like this variable name is safe from being over-written.

enter image description here

Scott Jibben
  • 2,229
  • 1
  • 14
  • 22
  • Fascinating. You are right. I'm going to file a bug report for this. – Raymond Camden Oct 09 '14 at 11:04
  • And... if you name a variable with that name, it gets overwritten. Nice. :\ – Raymond Camden Oct 09 '14 at 11:06
  • 1
    @RaymondCamden thanks for filing the bug report. I half expected that there was an option for the third argument (queryOptions) to account for the query variable name. One of the reasons I asked is that the CF11 docs/wiki does not have any info for this argument! "datasource", "result", and a few other options are listed in the examples, but it would be nice to have a complete list the options. I assume things like "cachedwithin", "name", etc. may be valid options... But only Adobe knows... I'll ask another question. I'm an aspiring point junky... ;) – Scott Jibben Oct 10 '14 at 09:23
  • If you make multiple calls to queryExecute(), _queryname_var0 is used each time. – Scott Jibben Oct 10 '14 at 09:34
  • Bug report comments say it was finally fixed in CF11 Update 5 (build 11,0,05,293506). Let us know if that is (hopefully) true ;-) – Leigh Jun 17 '15 at 21:18
  • @Leigh has the bugbase system moved or something? I get a ColdFusion error when I use the bugbase.adobe.com link. – Scott Jibben Jun 17 '15 at 21:38
  • @ScottJibben - No, the link below worked fine for me (earlier and just now). Maybe a temporary glitch? – Leigh Jun 17 '15 at 22:24
  • @Leigh, strange it works for me with IE 11 and Chrome, but it comes up with an error with Firefox 38.0.5: "You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members." – Scott Jibben Jun 17 '15 at 23:32
  • @ScottJibben - Weird. I'm using FF 38.0.5 too. Are you logged in? I was not. – Leigh Jun 18 '15 at 00:10
  • @Leigh, I'm not sure. I get this error even if I strip it down to just https://bugbase.adobe.com/ – Scott Jibben Jun 18 '15 at 02:21
  • @ScottJibben - ... That works fine for me too. That is why I was leaning towards differences like login status. Maybe the error is occurring while parsing login/session information? Since we know it is not browser version.. – Leigh Jun 20 '15 at 19:45
  • @Leigh, it started working for me now. Not sure what it could have been. – Scott Jibben Jun 21 '15 at 21:21
  • What was the actual bug? Debug output keeps logging `ExecuteQuery` instead of the assigned variable name. – Bernhard Döbler Jun 09 '17 at 08:54

1 Answers1

8

I'm posting this as an answer so I can maybe get some points. ;) It is a bug, pure and simple. I checked the Debugging template and the data is recorded with the incorrect name. I've filed a bug report here: https://bugbase.adobe.com/index.cfm?event=bug&id=3836702

Raymond Camden
  • 10,661
  • 3
  • 34
  • 68