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

Prototype change for a new sqlite3_file_control() that will cause the

-wal and -shm files to persist after the last database connection closes.

FossilOrigin-Name: e34c553bf04761e86f3bd72f91439c05886caa5c
This commit is contained in:
drh
2011-07-26 16:03:07 +00:00
parent 7d2dc7156c
commit f0b190d94c
6 changed files with 65 additions and 21 deletions

View File

@@ -1804,13 +1804,15 @@ int sqlite3WalClose(
*/
rc = sqlite3OsLock(pWal->pDbFd, SQLITE_LOCK_EXCLUSIVE);
if( rc==SQLITE_OK ){
int bPersistWal = -1;
if( pWal->exclusiveMode==WAL_NORMAL_MODE ){
pWal->exclusiveMode = WAL_EXCLUSIVE_MODE;
}
rc = sqlite3WalCheckpoint(
pWal, SQLITE_CHECKPOINT_PASSIVE, 0, 0, sync_flags, nBuf, zBuf, 0, 0
);
if( rc==SQLITE_OK ){
sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_PERSIST_WAL, &bPersistWal);
if( rc==SQLITE_OK && bPersistWal!=1 ){
isDelete = 1;
}
}