QoQ returns incorrect value when an operation results in decimal values

Description

In Query of Query, an operation resulting in a decimal value gets rounded down unless the original value is a decimal itself. ACF does not do that.

Column

Expected

Observed

ACF

qCount

8.6

8

8.57142857143

aCount

1.5

1

1.5


What worked?

Divide with a decimal value

Change the datatype from Integer to Decimal value


What *did not *work?

CAST ( as DECIMAL) did not work.

Environment

AWS, Windows Server 2019

Attachments

2

Activity

Show:

Pothys - MitrahSoft 23 July 2021 at 10:23

As per reporter said I closed this ticket.

SanjeevM 23 July 2021 at 02:05
Edited

Thank you .

We are good in staging environment with the SNAPSHOT version. I will wait for the SNAPSHOT to be released into stable release for PROD use.

Recommend to mark this ticket as closed.

Pothys - MitrahSoft 21 July 2021 at 15:29

I've checked with lucee version 5.3.8.189 as per you mentioned above like uses the Mysql result as QoQ source query. It returns a result with decimal points as same as queryNew() results as source query. Please see attached screenshot

SanjeevM 16 July 2021 at 16:25
Edited

Thank you .

I am on 5.3.8.189 stable, and just tried the code on the 5.3.8-193-SNAPSHOT.

It's working as expected. However it only does so where query dataset is generated by Lucee using queryNew() or likes of, but does NOT when the datasource is a query result from a Database. I think this is happening because Lucee has to guess the column data type. This MAY BE true as count(*) function has the return value as an Integer.

In my case, I experienced this issue when using MySQL (haven’t tried on other DB types). In the attached screenshot from my live system, you can see how modifying the dividing value (14) changes the result. My count(*) returns 0, so i used that value as example in the other columns.

Happy to add more information.

Pothys - MitrahSoft 16 July 2021 at 08:21

I've checked this ticket with lucee latest version 5.3.8-193-SNAPSHOT. This issue was fixed from 5.3.8.74-SNAPSHOT onwards by the ticket of . Could you please check the issue with lucee latest version and report here back?

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

Created 16 July 2021 at 02:47
Updated 23 July 2021 at 10:25
Resolved 23 July 2021 at 10:23