Index: ext/ota/ota.c ================================================================== --- ext/ota/ota.c +++ ext/ota/ota.c @@ -39,10 +39,15 @@ " target db.\n" "\n" , zArgv0); exit(1); } + +void report_default_vfs(){ + sqlite3_vfs *pVfs = sqlite3_vfs_find(0); + fprintf(stdout, "using vfs \"%s\"\n", pVfs->zName); +} int main(int argc, char **argv){ int i; const char *zTarget; /* Target database to apply OTA to */ const char *zOta; /* Database containing OTA */ @@ -60,10 +65,12 @@ }else if( argc!=3 ){ usage(argv[0]); } zTarget = argv[argc-2]; zOta = argv[argc-1]; + + report_default_vfs(); /* Open an OTA handle. If nStep is less than or equal to zero, call ** sqlite3ota_step() until either the OTA has been completely applied ** or an error occurs. Or, if nStep is greater than zero, call ** sqlite3ota_step() a maximum of nStep times. */ Index: src/vdbesort.c ================================================================== --- src/vdbesort.c +++ src/vdbesort.c @@ -599,11 +599,13 @@ ** Or, if an error occurs, return an SQLite error code. The final value of ** *pp is undefined in this case. */ static int vdbeSorterMapFile(SortSubtask *pTask, SorterFile *pFile, u8 **pp){ int rc = SQLITE_OK; - if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){ + if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) + && pFile->pFd->pMethods->xFetch + ){ rc = sqlite3OsFetch(pFile->pFd, 0, (int)pFile->iEof, (void**)pp); testcase( rc!=SQLITE_OK ); } return rc; } @@ -1121,11 +1123,11 @@ ** the specific VFS implementation. */ static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){ if( nByte<=(i64)(db->nMaxSorterMmap) ){ int rc = sqlite3OsTruncate(pFd, nByte); - if( rc==SQLITE_OK ){ + if( rc==SQLITE_OK && pFd->pMethods->xFetch ){ void *p = 0; sqlite3OsFetch(pFd, 0, (int)nByte, &p); sqlite3OsUnfetch(pFd, 0, p); } }