/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/test_multiplex.c.

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
...
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
    *rc = SQLITE_FULL;
    return 0;
  }
#endif

  *rc = multiplexSubFilename(pGroup, iChunk);
  if( (*rc)==SQLITE_OK && (pSubOpen = pGroup->aReal[iChunk].p)==0 ){
    int flags, rc2, bExists;
    if( iChunk==0 ) createFlag = (pGroup->flags & SQLITE_OPEN_CREATE)!=0;
    flags = pGroup->flags;
    if( createFlag ){
      flags |= SQLITE_OPEN_CREATE;
    }else if( pGroup->aReal[iChunk].z==0 ){
      return 0;
    }else{
................................................................................
    }
    pSubOpen = sqlite3_malloc( pOrigVfs->szOsFile );
    if( pSubOpen==0 ){
      *rc = SQLITE_NOMEM;
      return 0;
    }
    pGroup->aReal[iChunk].p = pSubOpen;
    rc2 = pOrigVfs->xOpen(pOrigVfs, pGroup->aReal[iChunk].z, pSubOpen,
                          flags, pOutFlags);
    if( rc2!=SQLITE_OK ){
      sqlite3_free(pSubOpen);
      pGroup->aReal[iChunk].p = 0;
      return 0;
    }
  }
  return pSubOpen;
}







|







 







|

|







301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
...
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
    *rc = SQLITE_FULL;
    return 0;
  }
#endif

  *rc = multiplexSubFilename(pGroup, iChunk);
  if( (*rc)==SQLITE_OK && (pSubOpen = pGroup->aReal[iChunk].p)==0 ){
    int flags, bExists;
    if( iChunk==0 ) createFlag = (pGroup->flags & SQLITE_OPEN_CREATE)!=0;
    flags = pGroup->flags;
    if( createFlag ){
      flags |= SQLITE_OPEN_CREATE;
    }else if( pGroup->aReal[iChunk].z==0 ){
      return 0;
    }else{
................................................................................
    }
    pSubOpen = sqlite3_malloc( pOrigVfs->szOsFile );
    if( pSubOpen==0 ){
      *rc = SQLITE_NOMEM;
      return 0;
    }
    pGroup->aReal[iChunk].p = pSubOpen;
    *rc = pOrigVfs->xOpen(pOrigVfs, pGroup->aReal[iChunk].z, pSubOpen,
                          flags, pOutFlags);
    if( (*rc)!=SQLITE_OK ){
      sqlite3_free(pSubOpen);
      pGroup->aReal[iChunk].p = 0;
      return 0;
    }
  }
  return pSubOpen;
}