diff options
author | dan <dan@noemail.net> | 2010-07-14 16:37:17 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-07-14 16:37:17 +0000 |
commit | 50833e32c1104742e94bb96fc6be6d809b766a96 (patch) | |
tree | dbf769b97873387ca7875d0bf4768fb3c1e6592d /src/wal.c | |
parent | ddb0ac4b9f3eaba3875e6b255975658a11dd204f (diff) | |
download | sqlite-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |