Undocumented changes to Query of Queries in CF2025
We’re updating an app from CF2021 to CF2025 but are running into issues with Query of Queries behavior changes and I haven’t seen them mentioned in any of the release documentation.
- Aggregate functions now return a row if there is no group by clause and the where condition fails.
<cfset foo = queryNew(
"id,total",
"integer,integer",
[
{ id = 1, total = 25 },
{ id = 2, total = 50 },
{ id = 3, total = 100 }
]
)>
<cfquery name="bar" dbtype="query">
select sum(total) total
from foo
where id = 20
</cfquery>
<cfdump var=#foo# />
<cfdump var=#bar# />The above is an example where the dump of #bar# will have 0 rows in CF2023 and below and will have 1 row in CF2025 with the value being an empty string. If `group by id` is added, all versions return 0 rows.
- Values that are NULL the database are no longer treated as NULLs and are treated as empty strings instead.
<cfset foo = queryNew(
"id,total",
"integer,varchar",
[
{ id = 1 },
{ id = 2, total = 50 },
{ id = 3, total = 100 }
]
)>
<cfquery name="bar" dbtype="query">
select *
from foo
where total is null
</cfquery>
<cfdump var=#foo# />
<cfdump var=#bar# />The above is an example where the dump of #bar# will have 1 row in CF2023 and below and will have 0 rows in CF2025. If the condition is changes to `where total = ''` then CF2025 will return 1 row but CF2023 and below return 0 rows.
We can work around these changes, but we are concerned there may be more changes lurking that we haven’t uncovered yet. Can you please provide a list of all changes to QoQs and if there is any way to re-enable old behavior?
Thanks!
