SQLite

Check-in [cec0a06c17]
Login

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

Overview
Comment:Add extra "PRAGMA mmap_size = N" statements to mmap1.test and mmap2.test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cec0a06c17435d5a35e76b52d6901ecda98f9916
User & Date: dan 2013-05-17 12:25:00.361
Context
2013-05-17
12:51
Use sum() instead of total() in the mptest/crash01.test script. (check-in: 8ba0fc9811 user: drh tags: trunk)
12:25
Add extra "PRAGMA mmap_size = N" statements to mmap1.test and mmap2.test. (check-in: cec0a06c17 user: dan tags: trunk)
12:10
In os_unix.c and os_win.c, initialize the default mmap-limit of a new file descriptor to the current global default mmap-limit, not the current global maximum allowable mmap-limit. (check-in: 1def4ea3a0 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/mmap1.test.
149
150
151
152
153
154
155

156
157
158
159
160
161
162
  do_execsql_test 2.4 {
    PRAGMA wal_checkpoint;
  } {0 24 24}
  db2 close
}

reset_db

db func rblob rblob
do_execsql_test 3.1 {
  PRAGMA auto_vacuum = 1;

  CREATE TABLE t1(a, b, UNIQUE(a, b));
  INSERT INTO t1 VALUES(rblob(500), rblob(500));
  INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    2







>







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
  do_execsql_test 2.4 {
    PRAGMA wal_checkpoint;
  } {0 24 24}
  db2 close
}

reset_db
execsql { PRAGMA mmap_size = 67108864; }
db func rblob rblob
do_execsql_test 3.1 {
  PRAGMA auto_vacuum = 1;

  CREATE TABLE t1(a, b, UNIQUE(a, b));
  INSERT INTO t1 VALUES(rblob(500), rblob(500));
  INSERT INTO t1 SELECT rblob(500), rblob(500) FROM t1; --    2
177
178
179
180
181
182
183

184
185
186
187
188
189
190
} {8}

#-------------------------------------------------------------------------
# Ensure that existing cursors using xFetch() pages see changes made
# to rows using the incrblob API.
#
reset_db

set aaa [string repeat a 400]
set bbb [string repeat b 400]
set ccc [string repeat c 400]
set ddd [string repeat d 400]
set eee [string repeat e 400]

do_execsql_test 4.1 {







>







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
} {8}

#-------------------------------------------------------------------------
# Ensure that existing cursors using xFetch() pages see changes made
# to rows using the incrblob API.
#
reset_db
execsql { PRAGMA mmap_size = 67108864; }
set aaa [string repeat a 400]
set bbb [string repeat b 400]
set ccc [string repeat c 400]
set ddd [string repeat d 400]
set eee [string repeat e 400]

do_execsql_test 4.1 {
226
227
228
229
230
231
232

233
234
235
236
237
238
239

#-------------------------------------------------------------------------
# Ensure that existing cursors holding xFetch() references are not 
# confused if those pages are moved to make way for the root page of a
# new table or index.
#
reset_db

do_execsql_test 5.1 {
  PRAGMA auto_vacuum = 2;
  PRAGMA page_size = 1024;
  CREATE TABLE t1(x);
  INSERT INTO t1 VALUES($aaa);
  INSERT INTO t1 VALUES($bbb);
  INSERT INTO t1 VALUES($ccc);







>







228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

#-------------------------------------------------------------------------
# Ensure that existing cursors holding xFetch() references are not 
# confused if those pages are moved to make way for the root page of a
# new table or index.
#
reset_db
execsql { PRAGMA mmap_size = 67108864; }
do_execsql_test 5.1 {
  PRAGMA auto_vacuum = 2;
  PRAGMA page_size = 1024;
  CREATE TABLE t1(x);
  INSERT INTO t1 VALUES($aaa);
  INSERT INTO t1 VALUES($bbb);
  INSERT INTO t1 VALUES($ccc);
Changes to test/mmap2.test.
41
42
43
44
45
46
47

48
49
50
51
52
53
54

foreach syscall {mmap mremap} {
  test_syscall uninstall 
  if {[catch {test_syscall install $syscall}]} continue

  for {set i 1} {$i < 20} {incr i} {
    reset_db


    test_syscall fault $i 1
    test_syscall errno $syscall ENOMEM
    set ::log ""

    do_execsql_test 1.$syscall.$i.1 {
      CREATE TABLE t1(a, b, UNIQUE(a, b));







>







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

foreach syscall {mmap mremap} {
  test_syscall uninstall 
  if {[catch {test_syscall install $syscall}]} continue

  for {set i 1} {$i < 20} {incr i} {
    reset_db
    execsql { PRAGMA mmap_size = 8000000 }

    test_syscall fault $i 1
    test_syscall errno $syscall ENOMEM
    set ::log ""

    do_execsql_test 1.$syscall.$i.1 {
      CREATE TABLE t1(a, b, UNIQUE(a, b));