/ Check-in [dc8118cd]
Login

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

Overview
Comment:When the multiplexor FileSize procedure fails to open the file, assume that the file is zero bytes in size.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nx-devkit
Files: files | file ages | folders
SHA1:dc8118cd89da71f2035c6ee07c0edb772bba2186
User & Date: drh 2011-12-13 02:41:13
Context
2011-12-13
04:08
When an sqlite3_auto_extension() function fails, report back its actual error code, not the generic SQLITE_ERROR. check-in: ce55f250 user: drh tags: nx-devkit
02:41
When the multiplexor FileSize procedure fails to open the file, assume that the file is zero bytes in size. check-in: dc8118cd user: drh tags: nx-devkit
01:34
Add a compile-time shutdown procedure to be called by sqlite3_shutdown() to undo the effects of the compile-time initialization procedure. check-in: c2ed86f5 user: drh tags: nx-devkit
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_multiplex.c.

   794    794   */
   795    795   static int multiplexFileSize(sqlite3_file *pConn, sqlite3_int64 *pSize){
   796    796     multiplexConn *p = (multiplexConn*)pConn;
   797    797     multiplexGroup *pGroup = p->pGroup;
   798    798     int rc = SQLITE_OK;
   799    799     int rc2;
   800    800     int i;
          801  +  *pSize = 0;
   801    802     multiplexEnter();
   802    803     if( !pGroup->bEnabled ){
   803    804       sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL);
   804    805       if( pSubOpen==0 ){
   805         -      rc = SQLITE_IOERR_FSTAT;
          806  +      rc = SQLITE_OK;  /* If SubOpen failed, assume a size of zero */
   806    807       }else{
   807    808         rc = pSubOpen->pMethods->xFileSize(pSubOpen, pSize);
   808    809       }
   809    810     }else{
   810    811       sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs;
   811    812       *pSize = 0;
   812    813       for(i=0; 1; i++){
   813    814         sqlite3_file *pSubOpen = 0;
   814    815         int exists = 0;
   815    816         rc = multiplexSubFilename(pGroup, i);
   816         -      if( rc ) break;
          817  +      if( rc ){ rc = SQLITE_OK; /* Assume size of zero */ break; }
   817    818         if( pGroup->flags & SQLITE_OPEN_DELETEONCLOSE ){
   818    819           exists = pGroup->nReal>=i && pGroup->aReal[i].p!=0;
   819    820           rc2 = SQLITE_OK;
   820    821         }else{
   821    822           rc2 = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[i].z,
   822    823               SQLITE_ACCESS_EXISTS, &exists);
   823    824         }