I don’t think +=
ever worked on empty strings. There was a bug fixed in Lucee’s QoQ behavior in 5.3.8 to make it match every other major database and that was making it so that an aggregated select who’s WHERE clause returns zero rows, always returns one row in the result (containing null, unless it was a count()
aggregate). You can test this and it’s the same in MySQL, MSSQL, etc. What’s odd is that the previous behavior would have returned zero records, which I would also expect to not work with +=
but perhaps you have more than one code path based on the record count.
The easy way to get the old behavior is to add a GROUP BY
clause as, per the SQL standard, that forces zero records returned when there are no matching rows, or if you have an existing if( qry.recordCount )
sort of check, you can add to that if( qry.recordCount && len( qry.aggregatedCol )
,
Sorry the new behavior caught your code off guard, but the long and short is this was a change made on purpose to bring QoQ’s grouping behavior in line with what you get out of a “real” DB.
Regarding the PDF fix, thanks for the ticket link It looks like there is already a pull request with the fix waiting to be merged for that. Hopefully it will make it into the next 5.3.8 LTS release.