I am using Lucee 5.3.2.77 and notice that Query of Query unions do not return the expected ‘DISTINCT’ result set but rather the ‘UNION ALL’ behaviour. Is there a way to get a distinct result set other than passing through a second QoQ? Is this a bug?
Simon, thanks for the suggestion of the GROUP BY work around that avoids a second QoQ. However every column would need to be included in the GROUP BY. It still seems to be a bug to be aware of and the behaviour should be the same as ACF.
I’m running Lucee 5.3.8.206
A QoQ with a UNION in it does not do a distinct in my code. Worked fine under ACF, same code under Lucee produces duplicate values from both sides.
trycf.com suggests it’s running on ACF - the parameter suggests Lucee but the output and cfdump format still suggest ACF behind the scenes
Yeah, we get it. Telling us your symptom over and over isn’t doing any good. Update your server to the latest stable version and you’ll get the fix
Yes, trycf is capable of running all sorts of versions of Railo, Lucee, and Adobe CF, but I’m not clear what you’re suggesting. If you’re asking what specific CF engine was running the code I posted above in the trycf link, you’re looking in the wrong place.
The original ticket that fixed the distincting behavior of UNION was resolved in December of 2020. [LDEV-3042] - Lucee
Later, a bug was found where that original fix didn’t account for all scenarios, which led to [LDEV-3830] - Lucee