SQLite

Check-in [55f5af5e17]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a bug whereby upgrading from a READ_FULL to a WRITE lock, and then back to a read lock was dropping all WAL locks.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 55f5af5e174df7a28deeb36faa51138926669897
User & Date: dan 2010-04-30 16:38:59.000
Context
2010-04-30
16:41
Fix a problem in the previous commit. Both unixShm.lockState and unixShm.readLock should be set to READ when downgrading from a WRITE to a READ lock (check-in: 90119fecbc user: dan tags: wal)
16:38
Fix a bug whereby upgrading from a READ_FULL to a WRITE lock, and then back to a read lock was dropping all WAL locks. (check-in: 55f5af5e17 user: dan tags: wal)
16:24
Reapply commits [837d82a929] and [c05e7dca17] that were accidentally overwritten. (check-in: 598de52700 user: dan tags: wal)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
5236
5237
5238
5239
5240
5241
5242

5243
5244

5245
5246
5247
5248
5249
5250
5251
5252
5236
5237
5238
5239
5240
5241
5242
5243
5244

5245

5246
5247
5248
5249
5250
5251
5252







+

-
+
-







            }
          }else{
            unixShmUnlock(pFile, p, UNIX_SHM_B);
            p->lockState = p->readLock = SQLITE_SHM_READ;
          }
        }
      }else if( p->lockState==SQLITE_SHM_WRITE ){
        rc = unixShmSharedLock(pFile, p, UNIX_SHM_A);
        unixShmUnlock(pFile, p, UNIX_SHM_C|UNIX_SHM_D);
        p->lockState = p->readLock;
        p->lockState = SQLITE_SHM_READ;
        rc = SQLITE_OK;
      }else{
        assert( p->lockState==SQLITE_SHM_RECOVER );
        unixShmUnlock(pFile, p, UNIX_SHM_MUTEX);
        sqlite3_mutex_leave(pFile->mutexRecov);
        p->lockState = p->readLock;
        rc = SQLITE_OK;
      }