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]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to