Hi all,
While playing around with sqlit3_open_v2, I was unpleasantly surprised
to find that my (test) database was deleted after opening it. It
turned out I was using
sqlite3_open_v2("test.db", &db, SQLITE_READONLY, 0);
instead of
sqlite3_open_v2("test.db", &db, SQLITE_OPEN_READONLY, 0);
Digging into the documentation, I found that SQLITE_OPEN_DELETEONCLOSE
== SQLITE_READONLY = 8. So this behavior is no bug, but the API makes
it very easy to make a fatal coding mistake that causes complete data
loss.
I think that the value 8 for SQLITE_OPEN_DELETEONCLOSE should be
deprecated to help people avoid such detrimental mistakes.
Best regards,
Jos
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users