SQL Precision issue with Lucee

We’re in the process of testing Lucee 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 you get 17.7999992 instead of 17.8 (which is what Lucee 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:

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

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

1 Like

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



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


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