/ Check-in [22e58330]
Login

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

Overview
Comment:Add an assert() in the Win32 VFS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | readonly-wal-recovery
Files: files | file ages | folders
SHA3-256:22e58330461736ca22d6f4d7eab897a3597de2e7434a6f4a474f0f0d7f964281
User & Date: mistachkin 2017-11-09 20:37:37
Context
2017-11-09
22:23
Revise and vastly simplify the Win32 SHM file locking semantics, allowing all new tests to pass. check-in: d0997b0f user: mistachkin tags: readonly-wal-recovery
20:37
Add an assert() in the Win32 VFS. check-in: 22e58330 user: mistachkin tags: readonly-wal-recovery
20:34
Enhance walro2.test to better ensure that readonly_shm clients are not using invalid *-shm files. check-in: ff630b66 user: dan tags: readonly-wal-recovery
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

3881
3882
3883
3884
3885
3886
3887

3888
3889
3890
3891
3892
3893
3894
      !osWriteFile(pFile->h, &notUsed1, 1, &notUsed2, pOverlapped) ){
    DWORD lastErrno = bReadOnly ? NO_ERROR : osGetLastError();
    if( !osReadFile(pFile->h, &notUsed1, 1, &notUsed2, pOverlapped) ){
      lastErrno = osGetLastError();
      if( winIsLockConflict(lastErrno) ){
        if( pLockType ) *pLockType = WINSHM_WRLCK;
      }else if( winIsLockMissing(lastErrno) ){

        if( pLockType ) *pLockType = WINSHM_UNLCK;
      }else{
        return SQLITE_IOERR_READ;
      }
    }else{
      if( winIsLockConflict(lastErrno) ){
        if( pLockType ) *pLockType = WINSHM_RDLCK;







>







3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
      !osWriteFile(pFile->h, &notUsed1, 1, &notUsed2, pOverlapped) ){
    DWORD lastErrno = bReadOnly ? NO_ERROR : osGetLastError();
    if( !osReadFile(pFile->h, &notUsed1, 1, &notUsed2, pOverlapped) ){
      lastErrno = osGetLastError();
      if( winIsLockConflict(lastErrno) ){
        if( pLockType ) *pLockType = WINSHM_WRLCK;
      }else if( winIsLockMissing(lastErrno) ){
        assert( bReadOnly );
        if( pLockType ) *pLockType = WINSHM_UNLCK;
      }else{
        return SQLITE_IOERR_READ;
      }
    }else{
      if( winIsLockConflict(lastErrno) ){
        if( pLockType ) *pLockType = WINSHM_RDLCK;