QoQ Count(*) crashes when object columns present

Description

Query of Query countYellow Star crashes with objects in columns, even when they aren't referenced

Can't cast Complex Object Type Struct to String
Use Built-In-Function "serialize(Struct):String" to create a String from Struct

<cfscript> obj = { a=1, b=2, c=3 }; q_obj = queryNew("id, obj, mod"); queryAddRow(q_obj); querySetCell(q_obj,"id",1); querySetCell(q_obj,"obj",duplicate(obj)); querySetCell(q_obj,"mod","aaa"); queryAddRow(q_obj); querySetCell(q_obj,"id",2); querySetCell(q_obj,"obj",duplicate(obj)); querySetCell(q_obj,"mod","bbb"); </cfscript> <cfdump var="#obj#"> <cfdump var="#q_obj#"> <cfquery dbtype="query" name="q_test"> select count(*) as r, mod from q_obj group by mod </cfquery> <cfdump var="#q_test#">

This works in ACF

Environment

None

Attachments

1
  • 03 Jan 2018, 12:23 pm

Activity

Show:

Michael Offner 28 October 2020 at 13:45

fixed with the QoQ changes

Zac Spitzer 26 October 2020 at 10:39

Looks like this was solved by 's QoQ work with https://luceeserver.atlassian.net/browse/LDEV-3042

Pothys - MitrahSoft 3 January 2018 at 12:24

I've added test case for this ticket & confirmed the issue happened on latest version of lucee 5.2.6.29 snapshot also. If we try to take a count in QoQ having complex structure in column, it throw error like Error.png even though it's not refereed in QoQ. In ACF, It working as expected.

Pull Request: https://github.com/lucee/Lucee/pull/362

Zac Spitzer 26 June 2017 at 05:46

this also fails with count(mod)

further discussion here https://dev.lucee.org/t/objects-in-qoq-group-by-throwing-an-error/2531

Zac Spitzer 26 January 2016 at 13:05

all that's thrown is the following

Can't cast Complex Object Type Struct to String Use Built-In-Function "serialize(Struct):String" to create a String from Struct
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

Affects versions

Created 13 January 2016 at 08:45
Updated 28 October 2020 at 13:45
Resolved 28 October 2020 at 13:45

Flag notifications