After version 5.3.7.48 it is not possible anymore to have different columns in a QoQ which has a UNION in it.
select top 5 name, code from organisation select name from rs where 1 = 1 union select code from rs where 1=1All this query does now, is return a recordset with 10 records and with just 1 column, namely “name”. But the value from the first 5 records contain the value from “name” and the last 5 records contain the value from “code”.
It used to return a recordset with 10 records with 2 columns, namely “name” and “code” and for the first 5 records only column “name” would be filled and for the last 5 records only column “code” would be filled.
I am not sure if this is a bug how it works now, or that it never was supposed to work like this. But we use this functionality in our code and cannot upgrade to a newer version of Lucee without changing our code. (and we use it a lot)
I know the behaviour how it works now is the same as in SQL, but the flexibilty of having the unions determine which columns they need, instead of making sure all the queries have the same columns, is quite handy.
Regards Jaco
OS: Window 10 (64 bit)
Java Version: 1.8.0_221 (Oracle Corporation) 64bit
Tomcat Version: Apache Tomcat/8.5.50
Lucee Version: 5.4.2.17