Query of Queries UNION returns incorrect results with cfqueryparam

Description

Query of Queries fails when UNIONing rows that have cfqueryparams in them.

1 2 3 4 5 6 7 8 9 10 11 12 13 <cfset oneRow = QueryNew('baz')> <cfset QueryAddRow(oneRow)> <cfquery name="broken" dbtype="query"> select <cfqueryparam value="1" cfsqltype="cf_sql_integer"> as num, 'a' as letter from oneRow union select <cfqueryparam value="1" cfsqltype="cf_sql_integer"> as num, 'b' as letter from oneRow </cfquery> <cfdump var="#broken#">

The result includes one row with the letter "a" and the number "1", and one row with the letter "b" and a blank number. Both numbers should be "1".

Run it at: https://trycf.com/gist/cd30ab29a6468471b5f9928d82aef9bb/lucee5

Workaround: Don't use cfqueryparam. If I just put in "1" as a literal value, the result is as expected.

P.S. This will block the migration of my large application from ACF to Lucee.

Environment

I'm actually running Lucee 5.3.1.87-RC, but it wasn't in the list of versions.
Ubuntu 16.04

Status

Assignee

Michael Offner

Reporter

Leon Miller-Out

Labels

None

Time tracking

0m

Sprint

None

Fix versions

Priority

Blocker
Configure