mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user