aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2011-12-12 18:21:44 +0000
committerdan <dan@noemail.net>2011-12-12 18:21:44 +0000
commitdc8ac1dd76d377ec8bc6ec271fd0bcbbf14573b5 (patch)
treefe2dce68c8cf554b29ffa33825eac4ca82d8d937 /src
parent743e003c0ea57b252cc6a90bd4f1df79057fbc6b (diff)
downloadsqlite-dc8ac1dd76d377ec8bc6ec271fd0bcbbf14573b5.tar.gz
sqlite-dc8ac1dd76d377ec8bc6ec271fd0bcbbf14573b5.zip
Fix for the xFileSize method of test_multiplex.c when used on a file opened with the DELETEONCLOSE flag set.
FossilOrigin-Name: 713071c493e9937a20c436b07299df428249e378
Diffstat (limited to 'src')
-rw-r--r--src/test_multiplex.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index 84c14f757..675ed9102 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -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);