SQLite

Check-in [8e65b91325]
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
Timelines: family | ancestors | descendants | both | nx-devkit
Files: files | file ages | folders
SHA1: 8e65b9132530e46c62bd1352bfc2e9c29f57af5f
User & Date: drh 2011-12-13 18:22:38.364
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: 43a1264088 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: 8e65b91325 user: drh tags: nx-devkit)
16:40
Add extra tests for the multiplexor VFS. No changes to code. (check-in: c7de6f683d user: dan tags: nx-devkit)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#endif

  /* Do extra initialization steps requested by the SQLITE_EXTRA_INIT
  ** compile-time option.
  */
#ifdef SQLITE_EXTRA_INIT
  if( rc==SQLITE_OK && sqlite3GlobalConfig.isInit ){
    int SQLITE_EXTRA_INIT(void);
    rc = SQLITE_EXTRA_INIT();
  }
#endif

  return rc;
}

/*







|
|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#endif

  /* Do extra initialization steps requested by the SQLITE_EXTRA_INIT
  ** compile-time option.
  */
#ifdef SQLITE_EXTRA_INIT
  if( rc==SQLITE_OK && sqlite3GlobalConfig.isInit ){
    int SQLITE_EXTRA_INIT(const char*);
    rc = SQLITE_EXTRA_INIT(0);
  }
#endif

  return rc;
}

/*
Changes to src/test_multiplex.c.
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
      pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags);
    }
    if( pSubOpen ){
      int exists, rc2, rc3;
      sqlite3_int64 sz;

      rc2 = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
      if( rc2==SQLITE_OK ){
        /* If the first overflow file exists and if the size of the main file
        ** is different from the chunk size, that means the chunk size is set
        ** set incorrectly.  So fix it.
        **
        ** Or, if the first overflow file does not exist and the main file is
        ** larger than the chunk size, that means the chunk size is too small.
        ** But we have no way of determining the intended chunk size, so 







|







451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
      pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags);
    }
    if( pSubOpen ){
      int exists, rc2, rc3;
      sqlite3_int64 sz;

      rc2 = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
      if( rc2==SQLITE_OK && zName ){
        /* If the first overflow file exists and if the size of the main file
        ** is different from the chunk size, that means the chunk size is set
        ** set incorrectly.  So fix it.
        **
        ** Or, if the first overflow file does not exist and the main file is
        ** larger than the chunk size, that means the chunk size is too small.
        ** But we have no way of determining the intended chunk size, so 
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867

/* Pass xSectorSize requests through to the original VFS unchanged.
*/
static int multiplexSectorSize(sqlite3_file *pConn){
  multiplexConn *p = (multiplexConn*)pConn;
  int rc;
  sqlite3_file *pSubOpen = multiplexSubOpen(p->pGroup, 0, &rc, NULL);
  if( pSubOpen ){
    return pSubOpen->pMethods->xSectorSize(pSubOpen);
  }
  return DEFAULT_SECTOR_SIZE;
}

/* Pass xDeviceCharacteristics requests through to the original VFS unchanged.
*/







|







853
854
855
856
857
858
859
860
861
862
863
864
865
866
867

/* Pass xSectorSize requests through to the original VFS unchanged.
*/
static int multiplexSectorSize(sqlite3_file *pConn){
  multiplexConn *p = (multiplexConn*)pConn;
  int rc;
  sqlite3_file *pSubOpen = multiplexSubOpen(p->pGroup, 0, &rc, NULL);
  if( pSubOpen && pSubOpen->pMethods->xSectorSize ){
    return pSubOpen->pMethods->xSectorSize(pSubOpen);
  }
  return DEFAULT_SECTOR_SIZE;
}

/* Pass xDeviceCharacteristics requests through to the original VFS unchanged.
*/
Changes to test/multiplex3.test.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
#***********************************************************************
#
# This file contains tests for error (IO, OOM etc.) handling when using
# the multiplexor extension with 8.3 filenames.
#

set testdir $env(SQLITE_TEST_DIR)
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
set ::testprefix multiplex3

ifcapable !8_3_names {
  puts -nonewline "SQLite compiled without SQLITE_ENABLE_8_3_NAMES. "
  puts            "Skipping tests zipvfsD-*."







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
#***********************************************************************
#
# This file contains tests for error (IO, OOM etc.) handling when using
# the multiplexor extension with 8.3 filenames.
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
set ::testprefix multiplex3

ifcapable !8_3_names {
  puts -nonewline "SQLite compiled without SQLITE_ENABLE_8_3_NAMES. "
  puts            "Skipping tests zipvfsD-*."