Bug #103124 Unexpected rounding value for updating Decimal field
Submitted: 26 Mar 12:03 Modified: 26 Mar 12:15
Reporter: Kevin Lau Email Updates:
Status: Verified Impact on me:
None 
Category:Connector for Node.js Severity:S1 (Critical)
Version:8.0.23 OS:Any
Assigned to: Rui Quelhas CPU Architecture:Any

[26 Mar 12:03] Kevin Lau
Description:
As per discussion
https://forums.mysql.com/read.php?44,695524,695600#msg-695600

Incorrect updating behavior such as:

Try updating negative values -56556.56, resulting in -56556.60
Try updating positive values 56556.56, resulting in 56556.60

How to repeat:
create table (
'ID' INT AUTO_INCREMENT,
`Total_Profit` DECIMAL(16,2) NULL);

Expected behavior
Mysql statement
update table set Total_Profit = '-56565656.56' where ID = '1';
Result will become -56565656.56 on the table.

Unexpected behavior in Nodejs connector

table.update()
.where(
`...`
)
.set(Total_Profit, -56565656.56)

The result will become -56565700.00 on the Mysql database
[26 Mar 12:15] MySQL Verification Team
Hello Kevin Lau,

Thank you for the report and feedback.
Verifying based on the comment from Rui at https://forums.mysql.com/read.php?44,695524,695600#msg-695600

regards,
Umesh