• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

A strange query of queries bug in CF11?

Explorer ,
Jun 27, 2014 Jun 27, 2014

Copy link to clipboard

Copied

Hi,

I have this strange query of queries result that could be a bug in CF11.  The result is fine in CF10.

Basically, I have 2 queries, qrA and qrB.  I do a join of the two in joinQr, after which I do a query of qrA.  Since I didn't alter qrA in any way, I would expect newQrA to give me the same result as qrA.  However it only gives me one row ("D").  Now, here's the strange thing:  If I start off qrA with the letters in ascending order ["A", "B", "C", "D"], then newQrA gives me the right result.

<cfset qrA = queryNew("")>

<cfset queryAddColumn( qrA, "size", "varchar", [ "D", "A", "B", "C" ] )>

<cfset qrB = queryNew("")>

<cfset queryAddColumn( qrB, "size", "varchar", [ "A" ] )>

<cfset queryAddColumn( qrB, "quantity", "integer", [ 0 ] )>

<cfquery name="joinQr" dbtype="query">

    select qrA.*, qrB.quantity

    from qrA, qrB

    where qrA.size = qrB.size

</cfquery>

<cfquery name="newQrA" dbtype="query">

    select *

    from qrA

</cfquery>

<cfdump var="#qrA#">

<cfdump var="#qrB#">

<cfdump var="#joinQr#">

<cfdump var="#newQrA#">

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 27, 2014 Jun 27, 2014

Copy link to clipboard

Copied

it'd help if you showed us what these queries look like, and possibly some sample data.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 27, 2014 Jun 27, 2014

Copy link to clipboard

Copied

Sorry, I had trouble inserting the code earlier.  It's fixed now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2014 Jun 28, 2014

Copy link to clipboard

Copied

For your interest, by coincidence, my first test was with

<cfset queryAddColumn( qrA, "size", "varchar", [ "A","B","C","D" ] )> 


It turns out that the order "A","B","C","D" works, whereas "D","A","B","C" fails. Quite funny, really.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 28, 2014 Jun 28, 2014

Copy link to clipboard

Copied

Thanks for confirming that it's a bug.  I will file a bug report.  I don't know what changes they made under the hood to QoQ, but to me this is serious because I can no longer trust the result of QoQ.  I wouldn't have caught this if a user didn't point out a result that made no sense.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 28, 2014 Jun 28, 2014

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2014 Jun 28, 2014

Copy link to clipboard

Copied

LATEST

Thanks. In discovering this flaw, you have done the Coldfusion community a big favour.

I have added my vote to your bug report. It reads: "+My vote. Query of Queries is a cornerstone of Coldfusion. This issue is so serious as to raise questions about the reliability of the entire language.".



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2014 Jun 28, 2014

Copy link to clipboard

Copied

I made an error when I first tested your code with array variable names instead. However, I have now been able to reproduce your result. It indeed looks like a bug.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation