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 authorizer argument or column metadata exceeds the V8 string limit #66522
import{Database,constants}from'node:sqlite';import{constantsas_constants}from'node:buffer';const{MAX_STRING_LENGTH}=_constants;constdb=newDatabase(':memory:');// '\u20ac' is 1 UTF-16 unit but 3 UTF-8 bytes.constname='\u20ac'.repeat(Math.ceil(MAX_STRING_LENGTH/3)+10);try{if(process.argv[2]==='columns'){db.exec(`CREATE TABLE t (x "${name}")`);db.prepare('SELECT x FROM t').columns();}else{db.setAuthorizer(()=>constants.SQLITE_OK);db.prepare(`CREATE TABLE "${name}" (x)`);}}catch(err){console.log(err.code);}
Run node repro.js for the authorizer trigger and node repro.js columns for the statement.columns() trigger.
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Both calls should throw a catchable error and not abort the process. With a 10-character name, both complete normally. When SQLite text doesn't fit in a JS string, node:sqlite already throws ERR_STRING_TOO_LONG for column values (#66209) and for error messages. These strings should do the same.
Activity
sqlite: throw on oversized strings instead of aborting
sqlite: throw on oversized strings instead of aborting