aboutsummaryrefslogtreecommitdiff
path: root/src/wal.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-07-14 16:37:17 +0000
committerdan <dan@noemail.net>2010-07-14 16:37:17 +0000
commit50833e32c1104742e94bb96fc6be6d809b766a96 (patch)
treedbf769b97873387ca7875d0bf4768fb3c1e6592d /src/wal.c
parentddb0ac4b9f3eaba3875e6b255975658a11dd204f (diff)
downloadsqlite-50833e32c1104742e94bb96fc6be6d809b766a96.tar.gz
sqlite-50833e32c1104742e94bb96fc6be6d809b766a96.zip
Test the libaries response to read-only or unreadable database, WAL and wal-index files. If a WAL file cannot be opened in read/write mode, return SQLITE_CANTOPEN to the caller.
FossilOrigin-Name: 45bb84c6283d803fc29077fdc2d06fa50ec06a59
Diffstat (limited to 'src/wal.c')
-rw-r--r--src/wal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wal.c b/src/wal.c
index d9563e619..769db036d 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -1226,6 +1226,9 @@ int sqlite3WalOpen(
/* Open file handle on the write-ahead log file. */
flags = (SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_WAL);
rc = sqlite3OsOpen(pVfs, zWalName, pRet->pWalFd, flags, &flags);
+ if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){
+ rc = SQLITE_CANTOPEN;
+ }
if( rc!=SQLITE_OK ){
walIndexClose(pRet, 0);