/ Check-in [4a153f01]
Login

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

Overview
Comment:If an open as read/write fails, do not try to reopen as read-only if in exclusive access mode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | stat3-trunk
Files: files | file ages | folders
SHA1: 4a153f010037db83107314269b240c0ece8430f8
User & Date: drh 2011-09-25 17:47:58
Original Comment: If an open as read/write fails, do not try to reopen as read-only if in exclusive access mode.
Context
2011-10-03
15:30
Merge the STAT3 changes into trunk. check-in: 774d0842 user: drh tags: trunk
2011-09-25
17:47
If an open as read/write fails, do not try to reopen as read-only if in exclusive access mode. Closed-Leaf check-in: 4a153f01 user: drh tags: stat3-trunk
2011-09-23
14:40
Merge the latest trunk changes into the stat3-trunk branch. check-in: 0beb88a9 user: drh tags: stat3-trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  2611   2611              h, zName, dwDesiredAccess, 
  2612   2612              h==INVALID_HANDLE_VALUE ? "failed" : "ok"));
  2613   2613   
  2614   2614     if( h==INVALID_HANDLE_VALUE ){
  2615   2615       pFile->lastErrno = GetLastError();
  2616   2616       winLogError(SQLITE_CANTOPEN, "winOpen", zUtf8Name);
  2617   2617       free(zConverted);
  2618         -    if( isReadWrite ){
         2618  +    if( isReadWrite && !isExclusive ){
  2619   2619         return winOpen(pVfs, zName, id, 
  2620   2620                ((flags|SQLITE_OPEN_READONLY)&~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)), pOutFlags);
  2621   2621       }else{
  2622   2622         return SQLITE_CANTOPEN_BKPT;
  2623   2623       }
  2624   2624     }
  2625   2625