Issue Summary
Recently I've updated my application env.
In that process, I've updated node-sqlite3 from v5.1.6 to v5.1.7
After that update, ROUND function behavior was changed.
This is minimum example.
const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database(':memory:');
db.serialize(() => {
db.each("SELECT ROUND(1.15, 1) as rounded", (err, row) => {
console.log(row);
});
});
- v5.1.6 ->
{ rounded: 1.2 }
- v5.1.7 ->
{ rounded: 1.1 }
For my usecase, expected value is 1.2.
However v5.1.7 returns 1.1. (Floating point handling was changed?)
The other hand, I've verified sqlite3 binary behavior.
$ echo "SELECT ROUND(1.15, 1)" | sqlite3
1.1
It returns 1.1. (v3.44.2 and v3.49.2)
Is it expected value? v5.1.7 was fixed to return same value of sqlite3 binary?
Once I'm going to use node-sqlite3@5.1.6.
However I'm bit confusing about this change.
Steps to Reproduce
- Store code in summary as js file
- Run it with both v5.1.6 and v5.1.7
Version
5.1.6 and 5.1.7
Node.js Version
v22.17.0
How did you install the library?
npm i sqlite3@5.1.7
Issue Summary
Recently I've updated my application env.
In that process, I've updated node-sqlite3 from v5.1.6 to v5.1.7
After that update,
ROUNDfunction behavior was changed.This is minimum example.
{ rounded: 1.2 }{ rounded: 1.1 }For my usecase, expected value is 1.2.
However v5.1.7 returns 1.1. (Floating point handling was changed?)
The other hand, I've verified sqlite3 binary behavior.
It returns 1.1. (v3.44.2 and v3.49.2)
Is it expected value? v5.1.7 was fixed to return same value of sqlite3 binary?
Once I'm going to use node-sqlite3@5.1.6.
However I'm bit confusing about this change.
Steps to Reproduce
Version
5.1.6 and 5.1.7
Node.js Version
v22.17.0
How did you install the library?
npm i sqlite3@5.1.7