On 12/11/17, advancenOO <[email protected]> wrote:
>
> At the same time, Mmap() is only used for reading by default, not writing.
> But why?

If the database is memory-mapped writable, then a stray pointer or
array overrun in the application (NB: not in SQLite - in the
application that uses SQLite) could easily overwrite part of the
database file and corrupt the database file.

It is also possible for this to happen without the use of writable
memory-maps, if the application corrupts internal SQLite data
structures and a subsequent COMMIT occurs.  But that is much less
likely, as SQLite would probably detect the situation before the
COMMIT completes, thus leaving the database intact.

-- 
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