1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Enable the use of shared cache for an in-memory database, so that separate

database connections can share the same in-memory database.

FossilOrigin-Name: 4590e433f2a595bb80fb061024b0a3d2ca25b7b2
This commit is contained in:
drh
2012-05-26 18:06:38 +00:00
parent 3773b29167
commit afc8b7f0c1
6 changed files with 52 additions and 22 deletions

View File

@@ -4360,6 +4360,8 @@ int sqlite3PagerOpen(
#ifndef SQLITE_OMIT_MEMORYDB
if( flags & PAGER_MEMORY ){
memDb = 1;
zPathname = sqlite3DbStrDup(0, zFilename);
nPathname = sqlite3Strlen30(zPathname);
zFilename = 0;
}
#endif
@@ -6743,7 +6745,8 @@ int sqlite3PagerWalCallback(Pager *pPager){
*/
int sqlite3PagerWalSupported(Pager *pPager){
const sqlite3_io_methods *pMethods = pPager->fd->pMethods;
return pPager->exclusiveMode || (pMethods->iVersion>=2 && pMethods->xShmMap);
return pPager->memDb==0 &&
(pPager->exclusiveMode || (pMethods->iVersion>=2 && pMethods->xShmMap));
}
/*