SQLite

Check-in [be292d5597]
Login

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

Overview
Comment:Add some OSTRACE calls for consistency.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | win32-none
Files: files | file ages | folders
SHA1: be292d559748a24ff012266a1f58ce6c027e0411
User & Date: mistachkin 2014-04-22 19:34:16.263
Context
2014-04-22
19:42
Change from using the win32-none VFS to just a query parameter. (check-in: ffceacf619 user: drh tags: win32-none)
19:34
Add some OSTRACE calls for consistency. (check-in: be292d5597 user: mistachkin tags: win32-none)
19:30
Add the win32-none VFS which omits rollback-journal locking. (check-in: 03e3c5a8b1 user: drh tags: win32-none)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_win.c.
2857
2858
2859
2860
2861
2862
2863

2864
2865
2866
2867
2868
2869
2870
  winFile *pFile = (winFile*)id;
  DWORD lastErrno = NO_ERROR;

  assert( id!=0 );
  OSTRACE(("LOCK file=%p, oldLock=%d(%d), newLock=%d\n",
           pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
  if( pFile->ctrlFlags & WINFILE_NOLOCK ){

    return SQLITE_OK;
  }

  /* If there is already a lock of this type or more restrictive on the
  ** OsFile, do nothing. Don't use the end_lock: exit path, as
  ** sqlite3OsEnterMutex() hasn't been called yet.
  */







>







2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
  winFile *pFile = (winFile*)id;
  DWORD lastErrno = NO_ERROR;

  assert( id!=0 );
  OSTRACE(("LOCK file=%p, oldLock=%d(%d), newLock=%d\n",
           pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
    OSTRACE(("LOCK-NOP file=%p, rc=SQLITE_OK\n", pFile->h));
    return SQLITE_OK;
  }

  /* If there is already a lock of this type or more restrictive on the
  ** OsFile, do nothing. Don't use the end_lock: exit path, as
  ** sqlite3OsEnterMutex() hasn't been called yet.
  */
2988
2989
2990
2991
2992
2993
2994

2995
2996
2997
2998
2999
3000
3001

  SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );
  OSTRACE(("TEST-WR-LOCK file=%p, pResOut=%p\n", pFile->h, pResOut));

  assert( id!=0 );
  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
    rc = 0;

  }else if( pFile->locktype>=RESERVED_LOCK ){
    rc = 1;
    OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (local)\n", pFile->h, rc));
  }else{
    rc = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0);
    if( rc ){
      winUnlockFile(&pFile->h, RESERVED_BYTE, 0, 1, 0);







>







2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003

  SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );
  OSTRACE(("TEST-WR-LOCK file=%p, pResOut=%p\n", pFile->h, pResOut));

  assert( id!=0 );
  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
    rc = 0;
    OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (nop)\n", pFile->h, rc));
  }else if( pFile->locktype>=RESERVED_LOCK ){
    rc = 1;
    OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (local)\n", pFile->h, rc));
  }else{
    rc = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0);
    if( rc ){
      winUnlockFile(&pFile->h, RESERVED_BYTE, 0, 1, 0);
3025
3026
3027
3028
3029
3030
3031

3032
3033
3034
3035
3036
3037
3038
  winFile *pFile = (winFile*)id;
  int rc = SQLITE_OK;
  assert( pFile!=0 );
  assert( locktype<=SHARED_LOCK );
  OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n",
           pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
  if( pFile->ctrlFlags & WINFILE_NOLOCK ){

    return SQLITE_OK;
  }
  type = pFile->locktype;
  if( type>=EXCLUSIVE_LOCK ){
    winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
    if( locktype==SHARED_LOCK && !winGetReadLock(pFile) ){
      /* This should never happen.  We should always be able to







>







3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
  winFile *pFile = (winFile*)id;
  int rc = SQLITE_OK;
  assert( pFile!=0 );
  assert( locktype<=SHARED_LOCK );
  OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n",
           pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
    OSTRACE(("UNLOCK-NOP file=%p, rc=SQLITE_OK\n", pFile->h));
    return SQLITE_OK;
  }
  type = pFile->locktype;
  if( type>=EXCLUSIVE_LOCK ){
    winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
    if( locktype==SHARED_LOCK && !winGetReadLock(pFile) ){
      /* This should never happen.  We should always be able to