SQLite

Check-in [a822a80d3c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the multiplexor, do not try to delete overflow files that do not exist. And assume all but the last overflow file is the size of the chunk size.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | nx-devkit
Files: files | file ages | folders
SHA1: a822a80d3cfe42b2fca6f8c9ff11762993114a27
User & Date: drh 2011-12-15 02:22:16.244
Context
2011-12-15
11:45
Fix some problems with dropped error codes in multiplexOpen(). (check-in: 2d50f78188 user: dan tags: nx-devkit)
02:22
In the multiplexor, do not try to delete overflow files that do not exist. And assume all but the last overflow file is the size of the chunk size. (check-in: a822a80d3c user: drh tags: nx-devkit)
2011-12-14
18:28
Merge the VFSNAME file-control addition into the nx-devkit branch. (check-in: 08c1dc517c user: drh tags: nx-devkit)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test_multiplex.c.
361
362
363
364
365
366
367

368

369
370
371
372
373
374
375
  multiplexGroup *pGroup,
  int iChunk,
  sqlite3_vfs *pOrigVfs
){
  sqlite3_file *pSubOpen = pGroup->aReal[iChunk].p;
  if( pSubOpen ){
    pSubOpen->pMethods->xClose(pSubOpen);

    if( pOrigVfs ) pOrigVfs->xDelete(pOrigVfs, pGroup->aReal[iChunk].z, 0);

    sqlite3_free(pGroup->aReal[iChunk].p);
  }
  sqlite3_free(pGroup->aReal[iChunk].z);
  memset(&pGroup->aReal[iChunk], 0, sizeof(pGroup->aReal[iChunk]));
}

/*







>
|
>







361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
  multiplexGroup *pGroup,
  int iChunk,
  sqlite3_vfs *pOrigVfs
){
  sqlite3_file *pSubOpen = pGroup->aReal[iChunk].p;
  if( pSubOpen ){
    pSubOpen->pMethods->xClose(pSubOpen);
    if( pOrigVfs && pGroup->aReal[iChunk].z ){
      pOrigVfs->xDelete(pOrigVfs, pGroup->aReal[iChunk].z, 0);
    }
    sqlite3_free(pGroup->aReal[iChunk].p);
  }
  sqlite3_free(pGroup->aReal[iChunk].z);
  memset(&pGroup->aReal[iChunk], 0, sizeof(pGroup->aReal[iChunk]));
}

/*
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
      assert( pSubOpen || rc!=SQLITE_OK );
      if( rc==SQLITE_OK ){
        sqlite3_int64 sz = 0;
        rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
        if( rc==SQLITE_OK && sz>pGroup->szChunk ){
          rc = SQLITE_IOERR_FSTAT;
        }
        *pSize += sz;
      }
    }
  }
  multiplexLeave();
  return rc;
}








|







766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
      assert( pSubOpen || rc!=SQLITE_OK );
      if( rc==SQLITE_OK ){
        sqlite3_int64 sz = 0;
        rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
        if( rc==SQLITE_OK && sz>pGroup->szChunk ){
          rc = SQLITE_IOERR_FSTAT;
        }
        *pSize = i*(sqlite3_int64)pGroup->szChunk + sz;
      }
    }
  }
  multiplexLeave();
  return rc;
}