mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

decimal values still string in result of query with decimalAsNumber true

mithrandirii opened this issue · comments

I found a problem with values of decimal columns in query result even if decimalAsNumber is set to true.

I think the problem is located here:

if (opts.supportBigNumbers && (opts.bigNumberStrings || !Number.isSafeInteger(Number(valDec)))) {

because Number.isSafeInteger(Number(valDec)) is always returning false if valDec is an decimal value. it's only working correctly for integer values.

how could we solve that ?

Ping

anything missing in my issue?

Thanks for reporting this error, it fell through the cracks in terms of testing. This is now corrected with 8f88f9d . (Will be corrected in next version 3.3.0, probably release this week)

ok, thx a lot!

closing since released in 3.3.0