Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Correctly record the fact that the SHM lock reached PENDING if it did so but failed to reach CHECKPOINT. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | wal |
Files: | files | file ages | folders |
SHA1: |
d9250e84ac1fc6590f8670e1d8016306 |
User & Date: | drh 2010-04-30 16:12:04.000 |
Context
2010-04-30
| ||
16:19 | Add xShmXXX() methods to the test VFS in test_devsym.test. (check-in: 1d20342424 user: dan tags: wal) | |
16:12 | Correctly record the fact that the SHM lock reached PENDING if it did so but failed to reach CHECKPOINT. (check-in: d9250e84ac user: drh tags: wal) | |
15:54 | Fix a couple uninitialized variables in the xShmLock method of the unix VFS. Improved debugging logic for xShmLock. (check-in: 69567c5fca user: drh tags: wal) | |
Changes
Changes to src/wal.c.
︙ | ︙ | |||
213 214 215 216 217 218 219 | ** type of reader lock (either SQLITE_SHM_READ or SQLITE_SHM_READ_FULL) ** in pWal->readerType. */ static int walSetLock(Wal *pWal, int desiredStatus){ int rc, got; if( pWal->lockState==desiredStatus ) return SQLITE_OK; rc = pWal->pVfs->xShmLock(pWal->pWIndex, desiredStatus, &got); | < | | | < > | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | ** type of reader lock (either SQLITE_SHM_READ or SQLITE_SHM_READ_FULL) ** in pWal->readerType. */ static int walSetLock(Wal *pWal, int desiredStatus){ int rc, got; if( pWal->lockState==desiredStatus ) return SQLITE_OK; rc = pWal->pVfs->xShmLock(pWal->pWIndex, desiredStatus, &got); pWal->lockState = got; if( got==SQLITE_SHM_READ_FULL || got==SQLITE_SHM_READ ){ pWal->readerType = got; pWal->lockState = SQLITE_SHM_READ; } return rc; } /* ** Update the header of the wal-index file. */ |
︙ | ︙ | |||
781 782 783 784 785 786 787 | Wal *pWal, /* Wal to close */ sqlite3_file *pFd, /* Database file */ int sync_flags, /* Flags to pass to OsSync() (or 0) */ u8 *zBuf /* Buffer of at least page-size bytes */ ){ int rc = SQLITE_OK; if( pWal ){ | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 | Wal *pWal, /* Wal to close */ sqlite3_file *pFd, /* Database file */ int sync_flags, /* Flags to pass to OsSync() (or 0) */ u8 *zBuf /* Buffer of at least page-size bytes */ ){ int rc = SQLITE_OK; if( pWal ){ pWal->pVfs->xShmClose(pWal->pWIndex); sqlite3OsClose(pWal->pFd); sqlite3_free(pWal); } return rc; } /* ** Try to read the wal-index header. Attempt to verify the header |
︙ | ︙ | |||
1032 1033 1034 1035 1036 1037 1038 | ** been overwritten by another writer, SQLITE_BUSY is returned. */ int sqlite3WalWriteLock(Wal *pWal, int op){ int rc; if( op ){ assert( pWal->lockState == SQLITE_SHM_READ ); rc = walSetLock(pWal, SQLITE_SHM_WRITE); | < < < < < < < < < < < < < < < < < < | 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | ** been overwritten by another writer, SQLITE_BUSY is returned. */ int sqlite3WalWriteLock(Wal *pWal, int op){ int rc; if( op ){ assert( pWal->lockState == SQLITE_SHM_READ ); rc = walSetLock(pWal, SQLITE_SHM_WRITE); }else if( pWal->lockState==SQLITE_SHM_WRITE ){ rc = walSetLock(pWal, SQLITE_SHM_READ); } return rc; } /* |
︙ | ︙ |