Given a 3.7.15.2 OSX binary fresh from the website, the following scenario
seems suspect:
> ./sqlite3 trial.db
sqlite> pragma secure_delete = 1;
1
sqlite> pragma journal_mode = persist;
persist
sqlite> pragma journal_size_limit = 4096;
4096
sqlite> pragma page_size;
1024
sqlite> create table x (x);
sqlite> insert into x values ('SQLite is a software library that implements
a self-contained, serverless, zero-configuration, transactional SQL
database engine. SQLite is the most widely deployed SQL database engine in
the world. The source code for SQLite is in the public domain.');
-- Repeat that four or five times.
Now, somewhere else, running:
strings trial.db-journal
gives me various repetitions of the inserted string present in the journal
file. This applies even after running 'delete from x;', at which point the
main database itself will not contain these strings.
---
Background of this is that awhile back I enabled journal_mode settings
similar to the above to reduce the amount of filesystem create/delete
churn. So converting to journal_mode = truncate would be a viable
workaround. But having the data remain visible when secure_delete was
turned on surprised me. Admittedly, writing zeros would reduce
performance, but that seems like the bargain one signs up for when enabling
secure_delete. WDYT?
AFAICT, actually running with this combination of settings is probably not
an improvement over journal_mode = truncate, since the OS has the advantage
of being able to release those pages without overwriting until they are
reallocated to new data (*). Which might suggest that when running with
secure_delete, journal_mode = persist should only persist a single page at
most, or even just operate exactly like journal_mode = truncate.
Thanks,
scott
(*) If your filesystem does not enforce strict ordering, a poorly-timed
crash could result in the block being allocated to a file without being
overwritten. I'm not overly concerned about that.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users