mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Handle very large URI pathnames for in-memory shared-cache databases.
FossilOrigin-Name: 586a94e85bc13700a2093734711c1367fa814b8c
This commit is contained in:
@@ -1959,16 +1959,18 @@ int sqlite3BtreeOpen(
|
||||
*/
|
||||
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){
|
||||
if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){
|
||||
int nFilename = sqlite3Strlen30(zFilename)+1;
|
||||
int nFullPathname = pVfs->mxPathname+1;
|
||||
char *zFullPathname = sqlite3Malloc(nFullPathname);
|
||||
char *zFullPathname = sqlite3Malloc(MAX(nFullPathname,nFilename));
|
||||
MUTEX_LOGIC( sqlite3_mutex *mutexShared; )
|
||||
|
||||
p->sharable = 1;
|
||||
if( !zFullPathname ){
|
||||
sqlite3_free(p);
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
if( isMemdb ){
|
||||
memcpy(zFullPathname, zFilename, sqlite3Strlen30(zFilename)+1);
|
||||
memcpy(zFullPathname, zFilename, nFilename);
|
||||
}else{
|
||||
rc = sqlite3OsFullPathname(pVfs, zFilename,
|
||||
nFullPathname, zFullPathname);
|
||||
|
Reference in New Issue
Block a user