/ Check-in [e461cb28]
Login

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

Overview
Comment:Avoid incrementing the SQLITE_LOOKASIDE_MISS_SIZE stat before sqlite3_open() returns. Fix test script problem in lookaside.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e461cb281959d8517296e3e4e934eba8206770b1a592cd7655b6567268da1634
User & Date: dan 2018-09-18 17:50:34
Context
2018-09-24
21:07
Avoid incrementing the SQLITE_LOOKASIDE_MISS_SIZE stat before sqlite3_open() returns. Fix test script problem in lookaside.test. check-in: 3bd94e43 user: drh tags: branch-3.25
2018-09-18
19:40
Fix a problem building on Android with SQLITE_ENABLE_BATCH_ATOMIC_WRITE set. check-in: e41e50fe user: dan tags: trunk
18:08
Merge all recent trunk enhancements. check-in: 655f0654 user: drh tags: expr-simplify
17:50
Avoid incrementing the SQLITE_LOOKASIDE_MISS_SIZE stat before sqlite3_open() returns. Fix test script problem in lookaside.test. check-in: e461cb28 user: dan tags: trunk
17:00
Enhance tester.tcl so that when "--malloctrace=1" is specified, the test generates self-contained Tcl scripts that present GUIs instead of *.sql files that require a separate program to interpret. check-in: de2e3cbd user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  3017   3017       }
  3018   3018     }
  3019   3019     sqlite3_mutex_enter(db->mutex);
  3020   3020     db->errMask = 0xff;
  3021   3021     db->nDb = 2;
  3022   3022     db->magic = SQLITE_MAGIC_BUSY;
  3023   3023     db->aDb = db->aDbStatic;
         3024  +  db->lookaside.bDisable = 1;
  3024   3025   
  3025   3026     assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
  3026   3027     memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
  3027   3028     db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS;
  3028   3029     db->autoCommit = 1;
  3029   3030     db->nextAutovac = -1;
  3030   3031     db->szMmap = sqlite3GlobalConfig.szMmap;

Changes to test/lookaside.test.

    20     20     finish_test
    21     21     return
    22     22   }
    23     23   
    24     24   # The tests in this file configure the lookaside allocator after a 
    25     25   # connection is opened. This will not work if there is any "presql"
    26     26   # configured (SQL run within the [sqlite3] wrapper in tester.tcl).
    27         -if {[info exists ::G(perm:presql)]} {
           27  +if {[info exists ::G(perm:dbconfig)] && $::G(perm:dbconfig)!=""} {
    28     28     finish_test
    29     29     return
    30     30   }
    31     31   
    32     32   test_set_config_pagecache 0 0
    33     33   
    34     34   catch {db close}
    35     35   sqlite3_shutdown
    36     36   sqlite3_initialize
    37     37   autoinstall_test_functions
           38  +
    38     39   sqlite3 db test.db
           40  +db cache size 4
    39     41   
    40     42   # Make sure sqlite3_db_config() and sqlite3_db_status are working.
    41     43   #
    42     44   do_test lookaside-1.1 {
    43     45     catch {sqlite3_config_error db}
    44     46   } {0}
    45     47   
................................................................................
    95     97   } {0}
    96     98   do_test lookaside-2.2 {
    97     99     db eval {CREATE TABLE t2(x);}
    98    100     foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0] break
    99    101     expr {$x==0 && $y<$z && $z>10 && $z<100}
   100    102   } {1}
   101    103   do_test lookaside-2.3 {
          104  +  db eval {SELECT 1}
   102    105     sqlite3_db_config_lookaside db 0 50 50
   103    106   } {5}  ;# SQLITE_BUSY
   104    107   do_test lookaside-2.4 {
   105    108     db cache flush
   106    109     sqlite3_db_config_lookaside db 0 50 50
   107    110   } {0}  ;# SQLITE_OK
   108    111   do_test lookaside-2.5 {