1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-04 04:42:17 +03:00

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
This commit is contained in:
dan
2010-07-14 16:37:17 +00:00
parent ddb0ac4b9f
commit 50833e32c1
5 changed files with 110 additions and 12 deletions

View File

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