diff options
author | drh <drh@noemail.net> | 2012-05-28 18:22:41 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2012-05-28 18:22:41 +0000 |
commit | 14bcd7d25e0902912d2eecef4839934e22f1b9db (patch) | |
tree | 5e011a6c08fa26cdd4388ce8713f04385ffb26d9 /src/pager.c | |
parent | e56467fc9ffdf634b939c33886e6513fc27376c3 (diff) | |
parent | 9cb7200815baf934dff0db605a38ff675bcef40e (diff) | |
download | sqlite-14bcd7d25e0902912d2eecef4839934e22f1b9db.tar.gz sqlite-14bcd7d25e0902912d2eecef4839934e22f1b9db.zip |
Merge the unicode61 tokenizer and the shared-cache-memory database changes
into the sessions branch.
FossilOrigin-Name: df817e70afc3f41e680d8f84dfa5772d5b3ae4d9
Diffstat (limited to 'src/pager.c')
-rw-r--r-- | src/pager.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/pager.c b/src/pager.c index b93e0aa86..425fb78ce 100644 --- a/src/pager.c +++ b/src/pager.c @@ -4360,7 +4360,12 @@ int sqlite3PagerOpen( #ifndef SQLITE_OMIT_MEMORYDB if( flags & PAGER_MEMORY ){ memDb = 1; - zFilename = 0; + if( zFilename && zFilename[0] ){ + zPathname = sqlite3DbStrDup(0, zFilename); + if( zPathname==0 ) return SQLITE_NOMEM; + nPathname = sqlite3Strlen30(zPathname); + zFilename = 0; + } } #endif @@ -6296,9 +6301,16 @@ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ /* ** Return the full pathname of the database file. +** +** Except, if the pager is in-memory only, then return an empty string if +** nullIfMemDb is true. This routine is called with nullIfMemDb==1 when +** used to report the filename to the user, for compatibility with legacy +** behavior. But when the Btree needs to know the filename for matching to +** shared cache, it uses nullIfMemDb==0 so that in-memory databases can +** participate in shared-cache. */ -const char *sqlite3PagerFilename(Pager *pPager){ - return pPager->zFilename; +const char *sqlite3PagerFilename(Pager *pPager, int nullIfMemDb){ + return (nullIfMemDb && pPager->memDb) ? "" : pPager->zFilename; } /* |