<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

Status

Assignee

Michael Offner

Reporter

Sam Daams

Labels

None

Priority

New
Configure