Works like a charm. Thanks! - Deon
-----Original Message----- From: sqlite-users <[email protected]> On Behalf Of Richard Hipp Sent: Friday, March 16, 2018 10:39 AM To: SQLite mailing list <[email protected]> Subject: Re: [sqlite] Programmatically corrupting a database On 3/16/18, Deon Brewis <[email protected]> wrote: > I am trying to write unit tests for some error detection & recovery > scenarios and would like to simulate the following type of corruptions: > > 1) Header corruption (easy) > 2) Corrupting a specific SQL Table/Index so that it can be read, but > inserts/updates will fail > 3) Corrupting a specific SQL Table/Index so that it can neither be > read nor written to > > Any ideas on how to do the last 2? First run the deadly "PRAGMA writable_schema=ON;" statement. Then make UPDATEs to the sqlite_master table to do things like change the root page number of the table or one of its indexes. -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailinglists.sqlite.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsqlite-users&data=02%7C01%7C%7Cb52a75ab16a34c1f984b08d58b64d9bb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636568187614528868&sdata=zKOCIZ7IfDLxHIR6WG98ZfFVtvkuvnG4%2Bqp5HiTCBYc%3D&reserved=0 _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

