/ Check-in [f632b870]
Login

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

Overview
Comment:Merge trunk fixes to swarmvtabfault.test and the lsm extension into this branch. No changes to core SQLite code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.21
Files: files | file ages | folders
SHA3-256: f632b87002a7ee9be569aacb5ce85bb7e9c86b7d77bb8d1bf8b55eb5be4ecc77
User & Date: dan 2017-10-23 20:20:42
Context
2017-10-23
21:24
On the amalgamation package, enable the sqlite_dbpage virtual table so that the .dbinfo command works in the CLI. check-in: 54b90b4f user: drh tags: branch-3.21
20:20
Merge trunk fixes to swarmvtabfault.test and the lsm extension into this branch. No changes to core SQLite code. check-in: f632b870 user: dan tags: branch-3.21
20:17
In the 'swarmvtabfault' test module, make sure to close the database handle prior to raising an error from the 'not found' callback script. check-in: f317037b user: mistachkin tags: trunk
16:34
Updates to test procedures so that they all work with encryption. No changes to the core SQLite code. check-in: 04813307 user: drh tags: branch-3.21
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/lsm1/lsm_shared.c.

   336    336     const int nUsMax = 100000;      /* Max value for nUs */
   337    337     int nUs = 1000;                 /* us to wait between DMS1 attempts */
   338    338     int rc;
   339    339   
   340    340     /* Obtain a pointer to the shared-memory header */
   341    341     assert( pDb->pShmhdr==0 );
   342    342     assert( pDb->bReadonly==0 );
   343         -  rc = lsmShmCacheChunks(pDb, 1);
   344         -  if( rc!=LSM_OK ) return rc;
   345         -  pDb->pShmhdr = (ShmHeader *)pDb->apShm[0];
   346    343   
   347    344     /* Block for an exclusive lock on DMS1. This lock serializes all calls
   348    345     ** to doDbConnect() and doDbDisconnect() across all processes.  */
   349    346     while( 1 ){
   350    347       rc = lsmShmLock(pDb, LSM_LOCK_DMS1, LSM_LOCK_EXCL, 1);
   351    348       if( rc!=LSM_BUSY ) break;
   352    349       lsmEnvSleep(pDb->pEnv, nUs);
   353    350       nUs = nUs * 2;
   354    351       if( nUs>nUsMax ) nUs = nUsMax;
   355    352     }
   356         -  if( rc!=LSM_OK ){
   357         -    pDb->pShmhdr = 0;
   358         -    return rc;
          353  +  if( rc==LSM_OK ){
          354  +    rc = lsmShmCacheChunks(pDb, 1);
   359    355     }
          356  +  if( rc!=LSM_OK ) return rc;
          357  +  pDb->pShmhdr = (ShmHeader *)pDb->apShm[0];
   360    358   
   361    359     /* Try an exclusive lock on DMS2/DMS3. If successful, this is the first 
   362    360     ** and only connection to the database. In this case initialize the 
   363    361     ** shared-memory and run log file recovery.  */
   364    362     assert( LSM_LOCK_DMS3==1+LSM_LOCK_DMS2 );
   365    363     rc = lsmShmTestLock(pDb, LSM_LOCK_DMS2, 2, LSM_LOCK_EXCL);
   366    364     if( rc==LSM_OK ){

Changes to test/swarmvtabfault.test.

    20     20     finish_test
    21     21     return
    22     22   }
    23     23   
    24     24   proc fetch_db {file} {
    25     25     forcedelete $file
    26     26     sqlite3 dbX $file
    27         -  dbX eval { CREATE TABLE t1(a INTEGER PRIMARY KEY, b) }
           27  +  set rc [catch {
           28  +    dbX eval { CREATE TABLE t1(a INTEGER PRIMARY KEY, b) }
           29  +  } res]
    28     30     dbX close
           31  +  if {$rc!=0} {error $res}
    29     32   }
    30     33   
    31     34   forcedelete test.db1
           35  +forcedelete test.db2
           36  +
    32     37   do_execsql_test 1.0 {
    33     38     ATTACH 'test.db1' AS aux;
    34     39     CREATE TABLE aux.t1(a INTEGER PRIMARY KEY, b);
    35     40     INSERT INTO aux.t1 VALUES(1, NULL);
    36     41     INSERT INTO aux.t1 VALUES(2, NULL);
    37     42     INSERT INTO aux.t1 VALUES(9, NULL);
    38     43     DETACH aux;