1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Fix for the xFileSize method of test_multiplex.c when used on a file opened with the DELETEONCLOSE flag set.

FossilOrigin-Name: 713071c493e9937a20c436b07299df428249e378
This commit is contained in:
dan
2011-12-12 18:21:44 +00:00
parent 743e003c0e
commit dc8ac1dd76
3 changed files with 15 additions and 10 deletions

View File

@@ -814,8 +814,13 @@ static int multiplexFileSize(sqlite3_file *pConn, sqlite3_int64 *pSize){
int exists = 0;
rc = multiplexSubFilename(pGroup, i);
if( rc ) break;
rc2 = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[i].z,
SQLITE_ACCESS_EXISTS, &exists);
if( pGroup->flags & SQLITE_OPEN_DELETEONCLOSE ){
exists = pGroup->nReal>=i && pGroup->aReal[i].p!=0;
rc2 = SQLITE_OK;
}else{
rc2 = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[i].z,
SQLITE_ACCESS_EXISTS, &exists);
}
if( rc2==SQLITE_OK && exists){
/* if it exists, open it */
pSubOpen = multiplexSubOpen(pGroup, i, &rc, NULL);