SQL Precision issue with Lucee 5.4.5.23

We’re in the process of testing Lucee 5.4.5.23 and I’m seeing a change in behavior, which looks like a bug to me. If you run the following code against the MSSQL JDBC driver in Lucee 5.4.5.23 you get 17.7999992 instead of 17.8 (which is what Lucee 5.4.3.2 produces):

select cast(17.8 as real)

I would expect this to return 17.8.

Is there a way to restore the old behavior or is this indeed a bug?

OS: CentOS 7
Java Version: 11.0.22
Tomcat Version: 9.0.84
Lucee Version: 5.4.5.23

In doing some research, this appears to have broken in the following commit:

If I test 5.4.5.5-SNAPSHOT the above SQL works as expected, but when I test 5.4.5.6-SNAPSHOT the code starts returning the unexpected value.

1 Like

I’ve added a comment to LDEV-4780 to explain the change of behavior:

https://luceeserver.atlassian.net/browse/LDEV-4780?focusedCommentId=55537

3 Likes

Since I haven’t heard back from any Lucee folks, I went ahead and just filed a new issue for this:

https://luceeserver.atlassian.net/browse/LDEV-4827

I wasn’t sure if maybe because LDEV-4780 was closed that might comments in that issue might not be as visible as a new issue.

1 Like