3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # The tests in this file verify that sorting works when the library is
14 # configured to use mmap(), but the temporary files generated by the
15 # sorter are too large to be completely mapped.
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
22 # Sort roughly 20MB of data. Once with a mmap limit of 5MB and once without.
24 foreach {itest limit} {
28 sqlite3_test_control SQLITE_TESTCTRL_SORTER_MMAP db $limit
29 do_execsql_test 1.$itest {
31 SELECT 1, randomblob(1000)
33 SELECT x+1, randomblob(1000) FROM r
36 SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
46 # Sort more than 2GB of data. At one point this was causing a problem.
47 # This test might take one minute or more to run.
50 PRAGMA cache_size = 20000;
52 SELECT 1, randomblob(1000)
54 SELECT x+1, randomblob(1000) FROM r
57 SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);