SQLite

Check-in [263c5fb280]
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 | trunk
Files: files | file ages | folders
SHA1: 263c5fb2802f8c84835e42fc66acb1065b7e42b9
User & Date: drh 2011-09-25 17:49:26.535
Context
2011-09-26
19:32
Changes to the analyzer script to make it work with zipvfs databases. (check-in: d82cffab6a user: dan tags: trunk)
2011-09-25
17:49
If an open as read/write fails, do not try to reopen as read-only if in exclusive access mode. (check-in: 263c5fb280 user: drh tags: trunk)
2011-09-24
09:54
Fix misc3.test so that it works with OMIT_MERGE_SORT builds. (check-in: 87946c627f user: dan tags: 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;
    }
  }