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.
GNU Lesser General Public License v2.1
366 stars 91 forks source link

Fix "cannot mix BigInt and other types" error #196

Closed ephys closed 2 years ago

ephys commented 2 years ago

Hello,

I'm trying to update this library in sequelize (https://github.com/sequelize/sequelize/pull/14187), but the newer version crashes with TypeError: Cannot mix BigInt and other types, use explicit conversions.

The error is thrown by this line:

return negate ? -1 * result : result;

According to the code, result is always a BigInt, so -1 * result will always throw. I've changed -1 to -1n in the code and it resolved the issue.

rusher commented 2 years ago

merge to develop branch, this will be part of 3.0.1 release

ephys commented 2 years ago

Thank you!