Version
v27.0.0-pre (main @ 4486dce)
Platform
Subsystem
sqlite
What steps will reproduce the bug?
const { DatabaseSync } = require('node:sqlite');
const db = new DatabaseSync(':memory:');
db.exec('CREATE TABLE r(id INTEGER PRIMARY KEY); CREATE TABLE o(x)');
db.prepare('INSERT INTO r VALUES (?)').run(2n ** 53n + 1n); // ERR_OUT_OF_RANGE, row is inserted
db.prepare('DELETE FROM o').run(); // ERR_OUT_OF_RANGE
How often does it reproduce? Is there a required condition?
Always, when readBigInts is off and the connection's last insert rowid exceeds 2^53.
What is the expected behavior? Why is that the expected behavior?
run() shouldn't throw after the write has committed. Proposal: return a BigInt for out-of-range values regardless of readBigInts. Is that acceptable, or should we only document it?
What do you see instead?
run() converts lastInsertRowid and changes only after stepping (src/node_sqlite.cc:4153). If a value is outside the safe-integer range, it throws, but the write has already committed. The last insert rowid belongs to the connection, so every later run() on that connection also throws. Not documented.
Additional information
No response
Version
v27.0.0-pre (main @ 4486dce)
Platform
Subsystem
sqlite
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always, when
readBigIntsis off and the connection's last insert rowid exceeds 2^53.What is the expected behavior? Why is that the expected behavior?
run()shouldn't throw after the write has committed. Proposal: return aBigIntfor out-of-range values regardless ofreadBigInts. Is that acceptable, or should we only document it?What do you see instead?
run()convertslastInsertRowidandchangesonly after stepping (src/node_sqlite.cc:4153). If a value is outside the safe-integer range, it throws, but the write has already committed. The last insert rowid belongs to the connection, so every laterrun()on that connection also throws. Not documented.Additional information
No response