/ Check-in [55f5af5e]
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 | SQL archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 55f5af5e174df7a28deeb36faa51138926669897
User & Date: dan 2010-04-30 16:38:59
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: 90119fec 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: 55f5af5e user: dan tags: wal
16:24
Reapply commits [837d82a929] and [c05e7dca17] that were accidentally overwritten. check-in: 598de527 user: dan tags: wal
Changes
Hide Diffs Unified Diffs 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
            }
          }else{
            unixShmUnlock(pFile, p, UNIX_SHM_B);
            p->lockState = p->readLock = SQLITE_SHM_READ;
          }
        }
      }else if( p->lockState==SQLITE_SHM_WRITE ){
        unixShmUnlock(pFile, p, UNIX_SHM_C|UNIX_SHM_D);
        p->lockState = p->readLock;
        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;
      }







|
|
|







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 = SQLITE_SHM_READ;
      }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;
      }