/ Check-in [fa3f5bcc]
Login

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

Overview
Comment:In the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when falling back from SQLITE_OPEN_READWRITE to SQLITE_OPEN_READONLY. Wait until the open fails completely.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fa3f5bcc23d9342f6df8ea15732988d637e9fa5dade85a73b05a9f66136d6964
User & Date: drh 2017-09-21 20:03:17
Context
2017-09-21
20:43
In the Windows VFS, when trying to open a database file read/write, if it fails check to see if the file exists and is read-only and immediately fall back to a read-only open attempt, rather than running the AV retry loop. check-in: 5d03c738 user: drh tags: trunk
20:03
In the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when falling back from SQLITE_OPEN_READWRITE to SQLITE_OPEN_READONLY. Wait until the open fails completely. check-in: fa3f5bcc user: drh tags: trunk
19:08
Fix harmless UB in the ICU extension. check-in: 68e9a840 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  5090   5090   #endif
  5091   5091     winLogIoerr(cnt, __LINE__);
  5092   5092   
  5093   5093     OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
  5094   5094              dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
  5095   5095   
  5096   5096     if( h==INVALID_HANDLE_VALUE ){
  5097         -    pFile->lastErrno = lastErrno;
  5098         -    winLogError(SQLITE_CANTOPEN, pFile->lastErrno, "winOpen", zUtf8Name);
  5099   5097       sqlite3_free(zConverted);
  5100   5098       sqlite3_free(zTmpname);
  5101   5099       if( isReadWrite && !isExclusive ){
  5102   5100         return winOpen(pVfs, zName, id,
  5103   5101            ((flags|SQLITE_OPEN_READONLY) &
  5104   5102                        ~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)),
  5105   5103            pOutFlags);
  5106   5104       }else{
         5105  +      pFile->lastErrno = lastErrno;
         5106  +      winLogError(SQLITE_CANTOPEN, pFile->lastErrno, "winOpen", zUtf8Name);
  5107   5107         return SQLITE_CANTOPEN_BKPT;
  5108   5108       }
  5109   5109     }
  5110   5110   
  5111   5111     if( pOutFlags ){
  5112   5112       if( isReadWrite ){
  5113   5113         *pOutFlags = SQLITE_OPEN_READWRITE;