/ Check-in [dd3510bb]
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:Fix the xCheckReservedLock() method on the windows VFS so that it cannot return a false positive when two or more processes use it at the same time on the same file. Ticket [7ff3120e4fa54abb55]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dd3510bb20ade173c81c9874c05466011c8a249d
User & Date: drh 2013-04-11 18:28:55
Context
2013-04-11
21:13
For the multi-process tester on Win32, make use of the GetCurrentProcessId API. check-in: f1b524b9 user: mistachkin tags: trunk
18:28
Fix the xCheckReservedLock() method on the windows VFS so that it cannot return a false positive when two or more processes use it at the same time on the same file. Ticket [7ff3120e4fa54abb55] check-in: dd3510bb user: drh tags: trunk
13:26
Fix pragma code generation so that it always outputs an OP_Trace opcode so that pragmas are shown in sqlite3_trace() output. check-in: 663f04bd user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/os_win.c.

  2698   2698     SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );
  2699   2699   
  2700   2700     assert( id!=0 );
  2701   2701     if( pFile->locktype>=RESERVED_LOCK ){
  2702   2702       rc = 1;
  2703   2703       OSTRACE(("TEST WR-LOCK %d %d (local)\n", pFile->h, rc));
  2704   2704     }else{
  2705         -    rc = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, RESERVED_BYTE, 0, 1, 0);
         2705  +    rc = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0);
  2706   2706       if( rc ){
  2707   2707         winUnlockFile(&pFile->h, RESERVED_BYTE, 0, 1, 0);
  2708   2708       }
  2709   2709       rc = !rc;
  2710   2710       OSTRACE(("TEST WR-LOCK %d %d (remote)\n", pFile->h, rc));
  2711   2711     }
  2712   2712     *pResOut = rc;