SQLite

Check-in [4a153f0100]
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
Timelines: family | ancestors | descendants | both | stat3-trunk
Files: files | file ages | folders
SHA1: 4a153f010037db83107314269b240c0ece8430f8
User & Date: drh 2011-09-25 17:47:58.118
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: 774d0842bc 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: 4a153f0100 user: drh tags: stat3-trunk)
2011-09-23
14:40
Merge the latest trunk changes into the stat3-trunk branch. (check-in: 0beb88a92c user: drh tags: stat3-trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_win.c.
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
           h, zName, dwDesiredAccess, 
           h==INVALID_HANDLE_VALUE ? "failed" : "ok"));

  if( h==INVALID_HANDLE_VALUE ){
    pFile->lastErrno = GetLastError();
    winLogError(SQLITE_CANTOPEN, "winOpen", zUtf8Name);
    free(zConverted);
    if( isReadWrite ){
      return winOpen(pVfs, zName, id, 
             ((flags|SQLITE_OPEN_READONLY)&~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)), pOutFlags);
    }else{
      return SQLITE_CANTOPEN_BKPT;
    }
  }








|







2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
           h, zName, dwDesiredAccess, 
           h==INVALID_HANDLE_VALUE ? "failed" : "ok"));

  if( h==INVALID_HANDLE_VALUE ){
    pFile->lastErrno = GetLastError();
    winLogError(SQLITE_CANTOPEN, "winOpen", zUtf8Name);
    free(zConverted);
    if( isReadWrite && !isExclusive ){
      return winOpen(pVfs, zName, id, 
             ((flags|SQLITE_OPEN_READONLY)&~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)), pOutFlags);
    }else{
      return SQLITE_CANTOPEN_BKPT;
    }
  }