[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    [sqlite] SQLITE_OPEN_DELETEONCLOSE == SQLITE_READONLY
From:       "Jos van den Oever" <jvdoever () gmail ! com>
Date:       2008-02-19 14:48:38
Message-ID: c2dbc4260802190648n70af5ea9m705398f036737294 () mail ! gmail ! com
[Download RAW message or body]

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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic