Version
main
Platform
Subsystem
sqlite
What steps will reproduce the bug?
import { Database } from 'node:sqlite';
const db = new Database(':memory:', { defensive: false });
db.enableDefensive(true);
db.close();
db.open();
db.exec('PRAGMA writable_schema=ON');
db.exec("UPDATE sqlite_schema SET sql='x'"); // succeeds; defensive is off again
console.log('UPDATE succeeded');
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
With defensive mode on, SQLite ignores PRAGMA writable_schema=ON (SQLITE_DBCONFIG_DEFENSIVE), so the UPDATE should fail with table sqlite_master may not be modified, as it does without the reopen.
What do you see instead?
Additional information
No response
Version
main
Platform
Subsystem
sqlite
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
With defensive mode on, SQLite ignores
PRAGMA writable_schema=ON(SQLITE_DBCONFIG_DEFENSIVE), so theUPDATEshould fail withtable sqlite_master may not be modified, as it does without the reopen.What do you see instead?
UPDATE succeededAdditional information
No response