I noticed a strange issue in Lucee.
For the following code:
<cfquery name="qGetData" datasource="#application.dsn#"> select 1 col1, 2 col2, 3 col3 from dual </cfquery> <cfset col1 = "bill"> <cfloop query="qGetData"> <cfset col1 = variables.col1 & col1> <cfoutput>#variables.col1# #col1# #col2# #col3#</cfoutput> </cfloop>
The result of the output is… bill1 1 2 3
This is problematic because it means that on the <cfset col1 = variables.col1 & col1> the col1 on the left means variables.col1, while the col1 on the right means qGetData.col1. This results in a very dangerous inconsistency.
In ACF, col1 is variables.col1 both on the left and on the right (of the = sign). This actually impacts me for a migration from ACF to Lucee as there are queries with * and columns in database like “label” and then, inside the loop, the label is also a variable. It’s virtually impossible to detect such situations as columns in database can be added (or removed).
Is there any setting that would make the behaviour similar with ACF? Is this a bug?