The pager now remembers when a VFS reports that a database file is

SQLITE_OPEN_MEMORY and treats that database as an in-memory database.

FossilOrigin-Name: 967b65623807ff992869da0a7d9b0105701939c4658a7aee37a30fb267869c6d
This commit is contained in:
drh 2021-10-23 20:32:27 +00:00
parent 88944e6f10
commit 021e228ec0
3 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Fix\sthe\smemdb\sVFS\sso\sthat\sit\sdoes\snot\sallow\smmap\sif\sit\sis\sresizable,\sand\sso\nthat\sit\snever\sopens\sa\sdisk\sfile\sfor\sany\sreason.
D 2021-10-23T17:46:00.160
C The\spager\snow\sremembers\swhen\sa\sVFS\sreports\sthat\sa\sdatabase\sfile\sis\nSQLITE_OPEN_MEMORY\sand\streats\sthat\sdatabase\sas\san\sin-memory\sdatabase.
D 2021-10-23T20:32:27.236
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -536,7 +536,7 @@ F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
F src/os_unix.c feac74a0ba7652c405ba30f61d9e738be717d15899f2915a129ef160a3e5b26b
F src/os_win.c 77d39873836f1831a9b0b91894fec45ab0e9ca8e067dc8c549e1d1eca1566fe9
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 71e3102150ae1b5567043ccda932aa81fb7de9848f501dafe491087c940e34dc
F src/pager.c bc10c191d18bffd3d76eda5f162799e43a9f875ecfe7c4869f752e2ddef87ea2
F src/pager.h 4bf9b3213a4b2bebbced5eaa8b219cf25d4a82f385d093cd64b7e93e5285f66f
F src/parse.y 0bd7971a7489bbf6c3726f1b50da6e508bdff8fa493e9cc3f5a96b12cbb2361e
F src/pcache.c 084e638432c610f95aea72b8509f0845d2791293f39d1b82f0c0a7e089c3bb6b
@ -1929,7 +1929,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 31671237e560b52dc27f707309269069a6bdcd017df9844908e77b57dc11f180
R 444deadb002e60bf5ed2135691fd7c7f
P 5ee14715a561d7522e9c6fd35a2ad3e6de526450025a99d2a523c2b27151be4f
R d561d8148c02fd21a733d83483d3f438
U drh
Z aa0780d26c17b9f3da4ad58aee5df686
Z 751678e6ce28d48782acb94cc1b3fb72

View File

@ -1 +1 @@
5ee14715a561d7522e9c6fd35a2ad3e6de526450025a99d2a523c2b27151be4f
967b65623807ff992869da0a7d9b0105701939c4658a7aee37a30fb267869c6d

View File

@ -630,6 +630,7 @@ struct Pager {
u8 noLock; /* Do not lock (except in WAL mode) */
u8 readOnly; /* True for a read-only database */
u8 memDb; /* True to inhibit all file I/O */
u8 memVfs; /* VFS-implemented memory database */
/**************************************************************************
** The following block contains those class members that change during
@ -4872,7 +4873,7 @@ int sqlite3PagerOpen(
rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
assert( !memDb );
#ifndef SQLITE_OMIT_DESERIALIZE
memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
pPager->memVfs = memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
#endif
readOnly = (fout&SQLITE_OPEN_READONLY)!=0;
@ -6809,7 +6810,7 @@ void sqlite3PagerCacheStat(Pager *pPager, int eStat, int reset, int *pnVal){
** Return true if this is an in-memory or temp-file backed pager.
*/
int sqlite3PagerIsMemdb(Pager *pPager){
return pPager->tempFile;
return pPager->tempFile || pPager->memVfs;
}
/*