SQLite

Check-in [40dd8a60be]
Login

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

Overview
Comment:Change the way the "crash" VFS (test6.c) handles SQLITE_FCNTL_SIZE_HINT.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 40dd8a60be0ca79e0d0bf3a2b5a43f13c02b4971
User & Date: dan 2011-08-23 19:46:02.000
Context
2011-08-23
20:11
If the application-defined openDirectory() function returns SQLITE_CANTOPEN, then silently ignore the error. This allows the chromium sandbox to disallow opening of directories without causing errors. (check-in: 880b51150a user: drh tags: trunk)
19:46
Change the way the "crash" VFS (test6.c) handles SQLITE_FCNTL_SIZE_HINT. (check-in: 40dd8a60be user: dan tags: trunk)
16:41
Have the "crash" VFS used by the tcl tests (test6.c) handle SQLITE_FCNTL_SIZE_HINT internally, instead of passing it directly through to the underlying VFS. This is important if the crash VFS is simulating non-default device characteristics such as SQLITE_DEVCAP_SEQUENTIAL or ATOMIC. (check-in: fac8bc8f34 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test6.c.
505
506
507
508
509
510
511

512
513


514
515
516
517
518
519
520
  return sqlite3OsCheckReservedLock(((CrashFile *)pFile)->pRealFile, pResOut);
}
static int cfFileControl(sqlite3_file *pFile, int op, void *pArg){
  if( op==SQLITE_FCNTL_SIZE_HINT ){
    CrashFile *pCrash = (CrashFile *)pFile;
    i64 nByte = *(i64 *)pArg;
    if( nByte>pCrash->iSize ){

      return cfWrite(pFile, "", 1, nByte-1);
    }


  }
  return sqlite3OsFileControl(((CrashFile *)pFile)->pRealFile, op, pArg);
}

/*
** The xSectorSize() and xDeviceCharacteristics() functions return
** the global values configured by the [sqlite_crashparams] tcl







>
|
|
>
>







505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
  return sqlite3OsCheckReservedLock(((CrashFile *)pFile)->pRealFile, pResOut);
}
static int cfFileControl(sqlite3_file *pFile, int op, void *pArg){
  if( op==SQLITE_FCNTL_SIZE_HINT ){
    CrashFile *pCrash = (CrashFile *)pFile;
    i64 nByte = *(i64 *)pArg;
    if( nByte>pCrash->iSize ){
      if( SQLITE_OK==writeListAppend(pFile, nByte, 0, 0) ){
        pCrash->iSize = nByte;
      }
    }
    return SQLITE_OK;
  }
  return sqlite3OsFileControl(((CrashFile *)pFile)->pRealFile, op, pArg);
}

/*
** The xSectorSize() and xDeviceCharacteristics() functions return
** the global values configured by the [sqlite_crashparams] tcl