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

Strange QoQ Behaviour

New Here ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

I am starting the process of upgrading one of my clients' test server in preparation to upgrading their production server from CF2016 to CF2021 and am seeing some strange QoQ behaviour.

 

I was able to reduce the code to the following:

 

<!---

SQL Server backend
create table qoq1 (id int,name varchar(10))
insert into qoq1 select 1,'One' union select 2,'Two' union select 3,'Three'
create table qoq2 (appid int,name varchar(10))
insert into qoq2 select 1,'Uno' union select 2,'Dos' union select 3,'Tres'
--->
<CFQuery Name="q1b" DataSource="myds">
select qoq1.id,qoq1.name from qoq1 order by qoq1.name
</CFQuery>
<CFQuery Name="q2b" DataSource="myds">
select qoq2.name as catname,qoq2.appid from qoq2 order by qoq2.name
</CFQuery>

<CFQuery Name="q3b" DBType="Query">
select q2b.catname,q1b.*
from q1b,q2b
where q1b.id=q2b.appid
order by q2b.catname,q1b.name
</CFQuery>

<CFDump Var="#q3b#">

 

The above dump in CF2016 shows 4 columns (which is strange, because it should only be showing 3 only.  Perhaps because "Preserve case for Struct keys for Serialization" is turned on in administrator).

 

cf2016.png

As you can see, the columns are ID, NAME, catname, and name, and both name columns show One, Two, and Three.

 

In CF2021 (update 4), the dump shows 3 columns (correct) named ID, catname, and name, but the values for name are Uno, Dos, and Tres, which is wrong.

 

cf2021.png

 

The same issue does not happen with self-created queries as below:

 

<!--- Try to emulate the same things with on the fly queries --->

<CFScript>
Q1 = queryNew("id,name","Integer,Varchar", [{id=1,name="One"},{id=2,name="Two"},{id=3,name="Three"}]);
Q2 = queryNew("appid,name","Integer,Varchar",[{appid=1,name="Uno"},{appid=2,name="Dos"},{appid=3,name="Tres"}]);
</CFScript>

<CFQuery Name="q1a" DBType="Query">
select q1.id,q1.name from q1 order by q1.name
</CFQuery>
<CFQuery Name="q2a" DBType="Query">
select q2.name as catname,q2.appid from q2 order by q2.name
</CFQuery>

<CFQuery Name="q3a" DBType="Query">
select q2a.catname,q1a.*
from q1a,q2a
where q1a.id=q2a.appid
order by q2a.catname,q1a.name
</CFQuery>

<CFDump Var="#q3a#">

 

cf2021_selfq.png

 

This appears to be a bug.  I can probably find a way to get around it, but I don't want to have to scrutinize 2mil+ lines of code.  I saw in this link that you can email Adobe and receive a fix for a QoQ issue, but that seems to be another issue.

TOPICS
Database access

Views

176

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

correct answers 1 Correct answer

Community Expert , Jun 29, 2022 Jun 29, 2022

Ross, I realize it seems to you that the bug discussed there may not apply, I'm willing to bet it does. It's easy to add the hotfix to find out.

 

And you no longer need to email them to get the fix. See a comment I  just added there, where I also link to a post on applying such special updates :

 

https://community.adobe.com/t5/coldfusion-discussions/coldfusion-2021-release-and-coldfusion-2018-release-september-updates/m-p/13038605#M192796

 

Please let us know whether it does or does not work f

...

Votes

Translate

Translate
Community Expert ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

Ross, I realize it seems to you that the bug discussed there may not apply, I'm willing to bet it does. It's easy to add the hotfix to find out.

 

And you no longer need to email them to get the fix. See a comment I  just added there, where I also link to a post on applying such special updates :

 

https://community.adobe.com/t5/coldfusion-discussions/coldfusion-2021-release-and-coldfusion-2018-re...

 

Please let us know whether it does or does not work for you. 


/Charlie (troubleshooter, carehart.org)

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
New Here ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

LATEST

Thanks Charlie.  I applied the HF and it solved the issue.  Will this HF be incorporated into an official update?  Or will I have to watch for this breaking again with the next update?

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