/ 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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  5236   5236               }
  5237   5237             }else{
  5238   5238               unixShmUnlock(pFile, p, UNIX_SHM_B);
  5239   5239               p->lockState = p->readLock = SQLITE_SHM_READ;
  5240   5240             }
  5241   5241           }
  5242   5242         }else if( p->lockState==SQLITE_SHM_WRITE ){
         5243  +        rc = unixShmSharedLock(pFile, p, UNIX_SHM_A);
  5243   5244           unixShmUnlock(pFile, p, UNIX_SHM_C|UNIX_SHM_D);
  5244         -        p->lockState = p->readLock;
  5245         -        rc = SQLITE_OK;
         5245  +        p->lockState = SQLITE_SHM_READ;
  5246   5246         }else{
  5247   5247           assert( p->lockState==SQLITE_SHM_RECOVER );
  5248   5248           unixShmUnlock(pFile, p, UNIX_SHM_MUTEX);
  5249   5249           sqlite3_mutex_leave(pFile->mutexRecov);
  5250   5250           p->lockState = p->readLock;
  5251   5251           rc = SQLITE_OK;
  5252   5252         }