1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

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
This commit is contained in:
drh
2007-09-03 15:19:34 +00:00
parent cd2543b6ae
commit 33f4e02af6
19 changed files with 170 additions and 85 deletions

View File

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