MySQL Forums
Forum List  »  Connector/Node.js

Re: Unexpected rounding value for updating Decimal field
Posted by: Rui Quelhas
Date: March 26, 2021 05:24AM

Hi Kevin,

looks like the rounding is happening on the X Plugin. Connector/Node.js decides if it needs to send an X Protocol V_DOUBLE value in order to accommodate the precision, however, in you particular case, it ends up sending a V_FLOAT instead, given there is no possibility of precision loss.

In my honest opinion, the X Plugin should be able to account for that, however, I've tried to reproduce the same scenario using the MySQL Shell and other connectors and came to the conclusion that they all end up sending V_DOUBLE no matter the case, and the problem does not exist. So I guess we can also do the same in Connector/Node.js.

I suggest you create a bug report describing this issue in our public issue tracker ( using the "Connector for Node.js" category.

As a workaround, I think the only possibility is to use a plain SQL statement with Session.sql().

Hope it helps.


Options: ReplyQuote

Written By
Re: Unexpected rounding value for updating Decimal field
March 26, 2021 05:24AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.