/ Check-in [022bf427]
Login

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

Overview
Comment:Fix a potential infinite loop (inserted by the previous check-in) on the multiplexWrite() method of the multiplexor.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nx-devkit
Files: files | file ages | folders
SHA1:022bf427c2edfe494ec7c222f436953ff56574a6
User & Date: drh 2011-12-16 05:09:46
Context
2011-12-16
05:50
Tweaks to the way multiplexSubOpen() works, for backwards compatibility. check-in: bb403388 user: drh tags: nx-devkit
05:09
Fix a potential infinite loop (inserted by the previous check-in) on the multiplexWrite() method of the multiplexor. check-in: 022bf427 user: drh tags: nx-devkit
04:57
The xTruncate method for the multiplexor now changes surplus overflow files to zero-length by default. Or if the "truncate" query parameter is used, it actually deletes the surplus overflow files. This allows VACUUM to shrink the database again. check-in: 5aefef04 user: drh tags: nx-devkit
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_multiplex.c.

   301    301       *rc = SQLITE_FULL;
   302    302       return 0;
   303    303     }
   304    304   #endif
   305    305   
   306    306     *rc = multiplexSubFilename(pGroup, iChunk);
   307    307     if( (*rc)==SQLITE_OK && (pSubOpen = pGroup->aReal[iChunk].p)==0 ){
   308         -    int flags, rc2, bExists;
          308  +    int flags, bExists;
   309    309       if( iChunk==0 ) createFlag = (pGroup->flags & SQLITE_OPEN_CREATE)!=0;
   310    310       flags = pGroup->flags;
   311    311       if( createFlag ){
   312    312         flags |= SQLITE_OPEN_CREATE;
   313    313       }else if( pGroup->aReal[iChunk].z==0 ){
   314    314         return 0;
   315    315       }else{
................................................................................
   320    320       }
   321    321       pSubOpen = sqlite3_malloc( pOrigVfs->szOsFile );
   322    322       if( pSubOpen==0 ){
   323    323         *rc = SQLITE_NOMEM;
   324    324         return 0;
   325    325       }
   326    326       pGroup->aReal[iChunk].p = pSubOpen;
   327         -    rc2 = pOrigVfs->xOpen(pOrigVfs, pGroup->aReal[iChunk].z, pSubOpen,
          327  +    *rc = pOrigVfs->xOpen(pOrigVfs, pGroup->aReal[iChunk].z, pSubOpen,
   328    328                             flags, pOutFlags);
   329         -    if( rc2!=SQLITE_OK ){
          329  +    if( (*rc)!=SQLITE_OK ){
   330    330         sqlite3_free(pSubOpen);
   331    331         pGroup->aReal[iChunk].p = 0;
   332    332         return 0;
   333    333       }
   334    334     }
   335    335     return pSubOpen;
   336    336   }