/ Check-in [ee8d3cee]
Login

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

Overview
Comment:Adjustments to mmap1.test so that it works better on windows. It still gets some answers wrong, but it no longer crashes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental-mmap
Files: files | file ages | folders
SHA1:ee8d3ceeec40d84adb8798f084b6f1215ab56d92
User & Date: drh 2013-04-02 20:29:33
Context
2013-04-02
20:55
Fix a resource leak in os_unix.c. check-in: b29cda03 user: dan tags: experimental-mmap
20:29
Adjustments to mmap1.test so that it works better on windows. It still gets some answers wrong, but it no longer crashes. check-in: ee8d3cee user: drh tags: experimental-mmap
20:19
Fix a bug in mmap2.test that was leaving an invalid sqlite3_log() callback installed, causing a crash. check-in: c0cdaa07 user: dan tags: experimental-mmap
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/mmap1.test.

    16     16   set testprefix mmap1
    17     17   
    18     18   proc nRead {db} {
    19     19     set bt [btree_from_db $db]
    20     20     db_enter $db
    21     21     array set stats [btree_pager_stats $bt]
    22     22     db_leave $db
           23  +  # puts [array get stats]
    23     24     return $stats(read)
    24     25   }
    25     26   
    26     27   foreach {t mmap_limit nRead c2init} {
    27         -  1.1 { PRAGMA mmap_limit = 70000000 }   4 {}
    28         -  1.2 { PRAGMA mmap_limit =    51200 } 156 {}
           28  +  1.1 { PRAGMA mmap_limit = 67108864 }   4 {}
           29  +  1.2 { PRAGMA mmap_limit =    53248 } 150 {}
    29     30     1.3 { PRAGMA mmap_limit =        0 } 344 {}
    30         -  1.4 { PRAGMA mmap_limit = 70000000 }   4 {PRAGMA mmap_limit = 70000000 }
    31         -  1.5 { PRAGMA mmap_limit =    51200 } 156 {PRAGMA mmap_limit = 70000000 }
    32         -  1.6 { PRAGMA mmap_limit =        0 } 344 {PRAGMA mmap_limit = 70000000 }
           31  +  1.4 { PRAGMA mmap_limit = 67108864 }   4 {PRAGMA mmap_limit = 67108864 }
           32  +  1.5 { PRAGMA mmap_limit =    53248 } 150 {PRAGMA mmap_limit = 67108864 }
           33  +  1.6 { PRAGMA mmap_limit =        0 } 344 {PRAGMA mmap_limit = 67108864 }
    33     34   } {
    34     35     do_multiclient_test tn {
           36  +    sql1 {PRAGMA page_size=1024}
    35     37       sql1 $mmap_limit
    36     38       sql2 $c2init
    37     39   
    38     40       code2 {
    39     41         set ::rcnt 0
    40     42         proc rblob {n} {
    41     43           set ::rcnt [expr (($::rcnt << 3) + $::rcnt + 456) & 0xFFFFFFFF]
    42     44           set str [format %.8x [expr $::rcnt ^ 0xbdf20da3]] 
    43     45           string range [string repeat $str [expr $n/4]] 1 $n
    44     46         }
    45     47         db2 func rblob rblob
    46     48       }
    47     49   
    48         -    sql2 { 
           50  +    sql2 {
           51  +      PRAGMA page_size=1024;
    49     52         PRAGMA auto_vacuum = 1;
    50     53         CREATE TABLE t1(a, b, UNIQUE(a, b));
    51     54         INSERT INTO t1 VALUES(rblob(500), rblob(500));
    52     55         INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    2
    53     56         INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    4
    54     57         INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    8
    55     58         INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --   16
................................................................................
    91     94   }
    92     95   
    93     96   reset_db
    94     97   db func rblob rblob
    95     98   
    96     99   do_execsql_test 2.1 {
    97    100     PRAGMA auto_vacuum = 1;
    98         -  PRAGMA mmap_limit = 70000000;
          101  +  PRAGMA mmap_limit = 67108864;
    99    102     PRAGMA journal_mode = wal;
   100    103     CREATE TABLE t1(a, b, UNIQUE(a, b));
   101    104     INSERT INTO t1 VALUES(rblob(500), rblob(500));
   102    105     INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    2
   103    106     INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    4
   104    107     INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    8
   105    108     INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --   16
................................................................................
   125    128     }
   126    129   } {16}
   127    130   
   128    131   do_execsql_test 2.4 {
   129    132     PRAGMA wal_checkpoint;
   130    133   } {0 24 24}
   131    134   
   132         -
          135  +db2 close
   133    136   reset_db
   134    137   db func rblob rblob
   135    138   do_execsql_test 3.1 {
   136    139     PRAGMA auto_vacuum = 1;
   137    140   
   138    141     CREATE TABLE t1(a, b, UNIQUE(a, b));
   139    142     INSERT INTO t1 VALUES(rblob(500), rblob(500));