tracker issue : CF-4122530

select a category, or use search below
(searches all categories and all time range)

Duplicate doesn't work on cached queries

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Mingo Hagen / Mingo Hagen (Mingo Hagen)

Created: 02/27/2016

Components: Database

Versions: 2016

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: ALL / Platforms All

Vote Count: 1

Duplicate ID:	CF-4126391

Problem Description:

Having a cachedWithin argument with a non-zero value in a cfquery, query.cfc or queryExecute() results in an empty query object when duplicate() is used.

Steps to Reproduce:

Run this:

  tempQuery = queryNew( "id,name", "integer,varchar" );
  queryAddRow( tempQuery );
  querySetCell( tempQuery, "id", 1, 1 );
  querySetCell( tempQuery, "name", "test", 1 );

  q1 = duplicate( tempQuery );

  sql = "SELECT * FROM q1";
  options = {
    dbType = "query"
    , cachedWithin = createTimeSpan( 0, 0, 3, 0 )

  q2 = duplicate( queryExecute( sql, [], options ));

  q1recordCount = q1.recordCount;
  q2recordCount = q2.recordCount;

  writeDump( q1 );
  writeDump( q1recordCount );

  writeDump( q2 );
  writeDump( q2recordCount );

Actual Result:

1	1	test

Expected Result:

1	1	test
1	1	test

Any Workarounds:

Don't use duplicate() or remove the cachedWithin argument (or set it to 0)

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4122530

External Customer Info:
External Company:  
External Customer Name: Mingo Hagen
External Customer Email:  
External Test Config: My Hardware and Environment details:

CF2016 on Windows 10



This is a regression, since this used to work in CF11.
Comment by External U.
4442 | February 27, 2016 04:04:39 PM GMT
We are working on a fix for the same. Once fixed, it will made be available as part of an update.
Comment by Vamseekrishna N.
4443 | February 29, 2016 01:36:57 AM GMT
@Vamseekrishna good to hear, shouldn't this bug's status be changed to ToFix then?
Comment by External U.
4444 | February 29, 2016 08:55:24 AM GMT
This issue has been fixed and will be released as part of an update. Please reach out to ColdFusion support at to get private hotfix.
Comment by Nimit S.
4445 | March 07, 2016 10:49:02 PM GMT
Is there a chance the glitch here could also cause <cfoutput query="something"> to only iterate once despite the query being multiple rows, and even something.recordCount reflecting the correct value? I realise this is all about duplicated queries, but given you've monkeyed with queries in CF2016, I thought it might cause the above too? In this case the "something" query is just a striaght query from <cfquery> with no caching, duplication or intermediary interference. <cfloop> over same query works fine.
Comment by External U.
4446 | March 08, 2016 05:09:21 AM GMT
@Nimit, I'll wait for at least ColdFusion 2016 Update 1 before updating anything. This bug just surfaced through testing our CMS on a dev version. @Adam, It wouldn't surprise me if all these cached query glitches are related. And I would be interested to see an update to CF2016_Performance.pdf after they have been fixed (and see that 822% drop drastically).
Comment by External U.
4447 | March 08, 2016 07:01:05 AM GMT
I am closing this bug as duplicate of bug #CF-4126391.
Comment by Nimit S.
4448 | March 10, 2016 11:12:34 PM GMT
Right. But can you answer my question, too?
Comment by External U.
4449 | March 11, 2016 12:57:30 AM GMT