<cfqueryparam> not handling decimals correctly

Description

This is also incompatible with ACF, but filing as bug. If trying to submit a decimal value, the maxlength is being read incorrectly by cfqueryparam, most likely due to https://luceeserver.atlassian.net/browse/LDEV-2260 (since this used to work as expected).

You will get the following error: “value [1000] is to large, defined maxlength is [7] but length of value is [8]” when trying to insert a value of “1000” into a decimal(7,0) column as follows: <cfqueryparam value="#form.insurance_amount#" cfsqltype="cf_sql_decimal" maxlength="7">. Apparently Lucee is reading this as 1,000.00, not 1000, which is what it should be doing (seeing as scale is 0 by default). So the count is off by 4 here. You can 'work around' this by removing maxlength, but as decimal is often used for detailed financial values, this is far from ideal. Bug confirmed here: https://luceeserver.atlassian.net/browse/LDEV-2260

Side note, error message should say "too", not "to" 🙂

Environment

None

Activity

Show:

Pothys - MitrahSoft 6 October 2020 at 05:41

As per the reporter said, I close this ticket.

Sam Daams 5 October 2020 at 10:22

Yes.

Pothys - MitrahSoft 5 October 2020 at 10:16

, If you agree means, shall I close this one with fixed version?

Sam Daams 3 October 2020 at 21:53

better late than never? I have confirmed with test case above and same 1000 value that the issue no longer exists. Apologies for the delay here - I was not using lucee locally and redid ALL the production files to work around this. But I have recently made the switch so should hit these bugs in development instead going forward, making it easier to test.

Pothys - MitrahSoft 22 May 2020 at 07:04
Edited

, Hope the issue was fixed in the lucee version 5.3.5.47-SNAPSHOT. So, could you please check and report here back. It'll help to improve the status of the ticket.

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 21 November 2019 at 12:50
Updated 1 September 2021 at 14:17
Resolved 6 October 2020 at 05:41

Flag notifications