regression: duplicate() not making a deep copy of a query

Description

On Lucee 6.1.0.243 we’ve discovered that if we create a query object, then duplicate() it to make a deep copy, and then add rows to the copy, whilst the rows are not added to the original query (as expected), if you use querycolumndata() on original, you’ll see the array length has been increased by the additional rows added to the copy.

This regression starts from Lucee 6.0.0.36. The issue was caused by this commit:

Try this code:

Notice we’re dumping qry1 at the end there, not qry2. You’ll see the result of querycolumndata() shows an additional array element has been added on the original query object.

Environment

None

Activity

Show:

Pothys - MitrahSoft 24 January 2025 at 14:29

I've checked this ticket with Lucee version 6.2.0.292-SNAPSHOT, and the issue has been resolved and is now working fine.

Zac Spitzer 23 January 2025 at 18:28

Zac Spitzer 16 January 2025 at 12:34

noticed this while step debugging

Zac Spitzer 16 January 2025 at 11:32
Edited

problem is when the queryColumn is duplicated, it’s not creating a new atomaticInteger for the new queryColumn

in addition the newQueryColumn was keeping a reference to the original query rather than the new one (unrelated to this bug) but that could cause other problems as operations on the column will be applied to original query

Zac Spitzer 16 January 2025 at 08:41

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Created 16 January 2025 at 07:16
Updated 24 January 2025 at 14:36
Resolved 24 January 2025 at 14:36