aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-09-03 15:19:34 +0000
committerdrh <drh@noemail.net>2007-09-03 15:19:34 +0000
commit33f4e02af65cd4ab4292a09cbd9d3d304f4cb536 (patch)
tree6d6d5b6b06e1454dbf4add9450a3dbf9c11eb3a1 /src/os_unix.c
parentcd2543b6ae6a3ac7dff3232624c93a073824bf06 (diff)
downloadsqlite-33f4e02af65cd4ab4292a09cbd9d3d304f4cb536.tar.gz
sqlite-33f4e02af65cd4ab4292a09cbd9d3d304f4cb536.zip
Honor the SQLITE_OPEN_ flags passed into sqlite3_open_v2(). Some
test cases added but more are needed. Ticket #2616. (CVS 4376) FossilOrigin-Name: 020a2b10d408f51d4ef3211c5f701f5378fd4625
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index f4a9ffe15..02db7eab6 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2368,15 +2368,26 @@ static int unixOpen(
** (a) Exactly one of the READWRITE and READONLY flags must be set, and
** (b) if CREATE is set, then READWRITE must also be set, and
** (c) if EXCLUSIVE is set, then CREATE must also be set.
+ ** (d) if DELETEONCLOSE is set, then CREATE must also be set.
*/
assert((isReadonly==0 || isReadWrite==0) && (isReadWrite || isReadonly));
assert(isCreate==0 || isReadWrite);
assert(isExclusive==0 || isCreate);
+ assert(isDelete==0 || isCreate);
+
+
+ /* The main DB, main journal, and master journal are never automatically
+ ** deleted
+ */
+ assert( eType!=SQLITE_OPEN_MAIN_DB || !isDelete );
+ assert( eType!=SQLITE_OPEN_MAIN_JOURNAL || !isDelete );
+ assert( eType!=SQLITE_OPEN_MASTER_JOURNAL || !isDelete );
/* Assert that the upper layer has set one of the "file-type" flags. */
assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB
|| eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL
|| eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL
+ || eType==SQLITE_OPEN_TRANSIENT_DB
);
if( isReadonly ) oflags |= O_RDONLY;