/ Check-in [8e65b913]
Login

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

Overview
Comment:Change the SQLITE_EXTRA_INIT routine to take a single argument which is a pointer to a string. Call SQLITE_EXTRA_INIT with a NULL argument. Fixes to multiplexor to treat the VFS properly in corner cases. Fix the initialization of multiplex3.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nx-devkit
Files: files | file ages | folders
SHA1:8e65b9132530e46c62bd1352bfc2e9c29f57af5f
User & Date: drh 2011-12-13 18:22:38
Context
2011-12-13
19:03
Add a hard limit to the number of chunks a multiplexed database may consist of if ENABLE_8_3_NAMES is defined. check-in: 43a12640 user: dan tags: nx-devkit
18:22
Change the SQLITE_EXTRA_INIT routine to take a single argument which is a pointer to a string. Call SQLITE_EXTRA_INIT with a NULL argument. Fixes to multiplexor to treat the VFS properly in corner cases. Fix the initialization of multiplex3.test. check-in: 8e65b913 user: drh tags: nx-devkit
16:40
Add extra tests for the multiplexor VFS. No changes to code. check-in: c7de6f68 user: dan tags: nx-devkit
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

   235    235   #endif
   236    236   
   237    237     /* Do extra initialization steps requested by the SQLITE_EXTRA_INIT
   238    238     ** compile-time option.
   239    239     */
   240    240   #ifdef SQLITE_EXTRA_INIT
   241    241     if( rc==SQLITE_OK && sqlite3GlobalConfig.isInit ){
   242         -    int SQLITE_EXTRA_INIT(void);
   243         -    rc = SQLITE_EXTRA_INIT();
          242  +    int SQLITE_EXTRA_INIT(const char*);
          243  +    rc = SQLITE_EXTRA_INIT(0);
   244    244     }
   245    245   #endif
   246    246   
   247    247     return rc;
   248    248   }
   249    249   
   250    250   /*

Changes to src/test_multiplex.c.

   451    451         pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags);
   452    452       }
   453    453       if( pSubOpen ){
   454    454         int exists, rc2, rc3;
   455    455         sqlite3_int64 sz;
   456    456   
   457    457         rc2 = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
   458         -      if( rc2==SQLITE_OK ){
          458  +      if( rc2==SQLITE_OK && zName ){
   459    459           /* If the first overflow file exists and if the size of the main file
   460    460           ** is different from the chunk size, that means the chunk size is set
   461    461           ** set incorrectly.  So fix it.
   462    462           **
   463    463           ** Or, if the first overflow file does not exist and the main file is
   464    464           ** larger than the chunk size, that means the chunk size is too small.
   465    465           ** But we have no way of determining the intended chunk size, so 
................................................................................
   853    853   
   854    854   /* Pass xSectorSize requests through to the original VFS unchanged.
   855    855   */
   856    856   static int multiplexSectorSize(sqlite3_file *pConn){
   857    857     multiplexConn *p = (multiplexConn*)pConn;
   858    858     int rc;
   859    859     sqlite3_file *pSubOpen = multiplexSubOpen(p->pGroup, 0, &rc, NULL);
   860         -  if( pSubOpen ){
          860  +  if( pSubOpen && pSubOpen->pMethods->xSectorSize ){
   861    861       return pSubOpen->pMethods->xSectorSize(pSubOpen);
   862    862     }
   863    863     return DEFAULT_SECTOR_SIZE;
   864    864   }
   865    865   
   866    866   /* Pass xDeviceCharacteristics requests through to the original VFS unchanged.
   867    867   */

Changes to test/multiplex3.test.

    10     10   #
    11     11   #***********************************************************************
    12     12   #
    13     13   # This file contains tests for error (IO, OOM etc.) handling when using
    14     14   # the multiplexor extension with 8.3 filenames.
    15     15   #
    16     16   
    17         -set testdir $env(SQLITE_TEST_DIR)
           17  +set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   source $testdir/malloc_common.tcl
    20     20   set ::testprefix multiplex3
    21     21   
    22     22   ifcapable !8_3_names {
    23     23     puts -nonewline "SQLite compiled without SQLITE_ENABLE_8_3_NAMES. "
    24     24     puts            "Skipping tests zipvfsD-*."