/ Check-in [b5da0d93]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Provide source code line numbers for errors in the Windows VFS generated by the winLogIoerr() routine.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b5da0d93cd1a3c0917399af3775a32327b883c8e
User & Date: drh 2015-03-26 15:27:32
Context
2015-03-26
17:04
Avoid leaving the malloc subsystem in a partially initialized state if the low-level initialization callback fails. check-in: 3e872011 user: drh tags: trunk
15:27
Provide source code line numbers for errors in the Windows VFS generated by the winLogIoerr() routine. check-in: b5da0d93 user: drh tags: trunk
14:29
Fix a harmless compiler warning in FTS3. check-in: 1688f60c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  1962   1962     }
  1963   1963     return 0;
  1964   1964   }
  1965   1965   
  1966   1966   /*
  1967   1967   ** Log a I/O error retry episode.
  1968   1968   */
  1969         -static void winLogIoerr(int nRetry){
         1969  +static void winLogIoerr(int nRetry, int lineno){
  1970   1970     if( nRetry ){
  1971   1971       sqlite3_log(SQLITE_IOERR,
  1972         -      "delayed %dms for lock/sharing conflict",
  1973         -      winIoerrRetryDelay*nRetry*(nRetry+1)/2
         1972  +      "delayed %dms for lock/sharing conflict at line %d",
         1973  +      winIoerrRetryDelay*nRetry*(nRetry+1)/2, lineno
  1974   1974       );
  1975   1975     }
  1976   1976   }
  1977   1977   
  1978   1978   #if SQLITE_OS_WINCE
  1979   1979   /*************************************************************************
  1980   1980   ** This section contains code for WinCE only.
................................................................................
  2544   2544       DWORD lastErrno;
  2545   2545       if( winRetryIoerr(&nRetry, &lastErrno) ) continue;
  2546   2546       pFile->lastErrno = lastErrno;
  2547   2547       OSTRACE(("READ file=%p, rc=SQLITE_IOERR_READ\n", pFile->h));
  2548   2548       return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
  2549   2549                          "winRead", pFile->zPath);
  2550   2550     }
  2551         -  winLogIoerr(nRetry);
         2551  +  winLogIoerr(nRetry, __LINE__);
  2552   2552     if( nRead<(DWORD)amt ){
  2553   2553       /* Unread parts of the buffer must be zero-filled */
  2554   2554       memset(&((char*)pBuf)[nRead], 0, amt-nRead);
  2555   2555       OSTRACE(("READ file=%p, rc=SQLITE_IOERR_SHORT_READ\n", pFile->h));
  2556   2556       return SQLITE_IOERR_SHORT_READ;
  2557   2557     }
  2558   2558   
................................................................................
  2655   2655         return winLogError(SQLITE_FULL, pFile->lastErrno,
  2656   2656                            "winWrite1", pFile->zPath);
  2657   2657       }
  2658   2658       OSTRACE(("WRITE file=%p, rc=SQLITE_IOERR_WRITE\n", pFile->h));
  2659   2659       return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno,
  2660   2660                          "winWrite2", pFile->zPath);
  2661   2661     }else{
  2662         -    winLogIoerr(nRetry);
         2662  +    winLogIoerr(nRetry, __LINE__);
  2663   2663     }
  2664   2664     OSTRACE(("WRITE file=%p, rc=SQLITE_OK\n", pFile->h));
  2665   2665     return SQLITE_OK;
  2666   2666   }
  2667   2667   
  2668   2668   /*
  2669   2669   ** Truncate an open file to a specified size
................................................................................
  4748   4748                                 dwFlagsAndAttributes,
  4749   4749                                 NULL))==INVALID_HANDLE_VALUE &&
  4750   4750                                 winRetryIoerr(&cnt, &lastErrno) ){
  4751   4751                  /* Noop */
  4752   4752       }
  4753   4753     }
  4754   4754   #endif
  4755         -  winLogIoerr(cnt);
         4755  +  winLogIoerr(cnt, __LINE__);
  4756   4756   
  4757   4757     OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
  4758   4758              dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
  4759   4759   
  4760   4760     if( h==INVALID_HANDLE_VALUE ){
  4761   4761       pFile->lastErrno = lastErrno;
  4762   4762       winLogError(SQLITE_CANTOPEN, pFile->lastErrno, "winOpen", zUtf8Name);
................................................................................
  4932   4932         }
  4933   4933       } while(1);
  4934   4934     }
  4935   4935   #endif
  4936   4936     if( rc && rc!=SQLITE_IOERR_DELETE_NOENT ){
  4937   4937       rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename);
  4938   4938     }else{
  4939         -    winLogIoerr(cnt);
         4939  +    winLogIoerr(cnt, __LINE__);
  4940   4940     }
  4941   4941     sqlite3_free(zConverted);
  4942   4942     OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc)));
  4943   4943     return rc;
  4944   4944   }
  4945   4945   
  4946   4946   /*
................................................................................
  4982   4982             && sAttrData.nFileSizeHigh==0
  4983   4983             && sAttrData.nFileSizeLow==0 ){
  4984   4984           attr = INVALID_FILE_ATTRIBUTES;
  4985   4985         }else{
  4986   4986           attr = sAttrData.dwFileAttributes;
  4987   4987         }
  4988   4988       }else{
  4989         -      winLogIoerr(cnt);
         4989  +      winLogIoerr(cnt, __LINE__);
  4990   4990         if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){
  4991   4991           sqlite3_free(zConverted);
  4992   4992           return winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess",
  4993   4993                              zFilename);
  4994   4994         }else{
  4995   4995           attr = INVALID_FILE_ATTRIBUTES;
  4996   4996         }