Dan, I see, seems like this works. But I also noticed that if I provide version 2 of vfs, I won't get benefits of file-mapping (I assume because my query that worked 9 seconds for file-mapping now back 27 seconds). I'm not sure this is right, but calling sqlite original xRead very abstract by its nature, so nobody ever expected particular implementation from sqlite and if file mapping is on, sqlite could use file-mapping even if user provided ver.2 of io routines.
In other word, if sqlite doesn't expect special knowledge of file mapping existence for vfs-free client then it should not expect this from client that uses vfs Max On Mon, Apr 8, 2013 at 1:56 PM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 04/08/2013 04:40 PM, Max Vlasov wrote: > >> On Mon, Apr 8, 2013 at 1:23 PM, Dan Kennedy <danielk1...@gmail.com> >> wrote: >> >> >>> Right. But a VFS is not obliged to support the new xFetch() and >>> xUnfetch() methods (used to read data from a memory mapped file). >>> And if it doesn't, SQLite will use xRead() exclusively. >>> >>> It always uses xWrite() to write - whether mmap is enabled or not. >>> >>> >>> Great, what is the correct way of not providing fetch procedures? Maybe >> I >> did something wrong? >> - If I call original xFetch/xUnfetch from mine - no xRead called, >> - if I provide Nil as the function address, then I get Access violation >> (00000000) so probably sqlite tries to call it anyway. >> - If return SQLITE_Error from xFetch, xUnfetch, I get sqlite logic error. >> > > Set the iVersion field of your sqlite3_io_methods struct to 2 (not 3). > > The idea is that if you have an existing VFS, it should keep working > as is without any modifications. If you find this is not the case, it > may be a bug. > > Dan. > > > ______________________________**_________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users> > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users