/ Check-in [dceed2c8]
Login

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

Overview
Comment:Add test file sort3.test, which should have been part of commit [9d3351b8d7].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | threads
Files: files | file ages | folders
SHA1: dceed2c803fca23c83c02c448d5ae7c4698efee1
User & Date: dan 2014-04-04 07:52:44
Context
2014-04-04
18:37
Merge the latest trunk changes into the threads branch. check-in: 39ac79cf user: drh tags: threads
07:52
Add test file sort3.test, which should have been part of commit [9d3351b8d7]. check-in: dceed2c8 user: dan tags: threads
02:13
Change vdbeSorterExtendFile() so that it makes a best effort to create the PMA file of the desired size, but does not return an error if unable. check-in: 217814bc user: drh tags: threads
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added test/sort3.test.

            1  +# 2014 March 25.
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            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.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library. 
           12  +#
           13  +
           14  +set testdir [file dirname $argv0]
           15  +source $testdir/tester.tcl
           16  +set testprefix sort3
           17  +
           18  +# Sort roughly 20MB of data. Once with a mmap limit of 5MB and once without.
           19  +#
           20  +foreach {itest limit} {
           21  +  1 5000000
           22  +  2 0x7FFFFFFF
           23  +} {
           24  +  sqlite3_test_control SQLITE_TESTCTRL_SORTER_MMAP db $limit
           25  +  do_execsql_test 1.$itest {
           26  +    WITH r(x,y) AS (
           27  +        SELECT 1, randomblob(1000)
           28  +        UNION ALL
           29  +        SELECT x+1, randomblob(1000) FROM r
           30  +        LIMIT 20000
           31  +    )
           32  +    SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
           33  +  } {
           34  +    4000 4000000 
           35  +    4000 4000000 
           36  +    4000 4000000 
           37  +    4000 4000000 
           38  +    4000 4000000
           39  +  }
           40  +}
           41  +
           42  +# Sort more than 2GB of data. At one point this was causing a problem.
           43  +# This test might take one minute or more to run.
           44  +#
           45  +do_execsql_test 2 {
           46  +  PRAGMA cache_size = 20000;
           47  +  WITH r(x,y) AS (
           48  +    SELECT 1, randomblob(1000)
           49  +    UNION ALL
           50  +    SELECT x+1, randomblob(1000) FROM r
           51  +    LIMIT 2200000
           52  +  )
           53  +  SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
           54  +} {
           55  +  440000 440000000 
           56  +  440000 440000000 
           57  +  440000 440000000 
           58  +  440000 440000000 
           59  +  440000 440000000
           60  +}
           61  +
           62  +finish_test
           63  +