You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sqlite: process aborts when an SQLite error message exceeds the V8 string limit #66520
import{Database}from'node:sqlite';import{constants}from'node:buffer';constdb=newDatabase(':memory:');// '\u20ac' is 1 UTF-16 unit but 3 UTF-8 bytes.constname='\u20ac'.repeat(Math.ceil(constants.MAX_STRING_LENGTH/3)+10);try{db.prepare(`SELECT 1 FROM "${name}"`);}catch(err){console.log(err.code,err.message.length);}
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
prepare() should throw a catchable error and not abort the process. With a 10-character name, the same code prints ERR_SQLITE_ERROR 25. ERR_SQLITE_ERROR is documented as "An error was returned from SQLite." If the message can't be represented as a JS string, the error should fall back to ERR_STRING_TOO_LONG or to an ERR_SQLITE_ERROR with a truncated message.
Activity
sqlite: throw on oversized strings instead of aborting
sqlite: throw on oversized strings instead of aborting