1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00
Files
sqlite/test/sort3.test
dan 8daefc2af0 Add test file sort3.test, which should have been part of commit [9d3351b8d7].
FossilOrigin-Name: dceed2c803fca23c83c02c448d5ae7c4698efee1
2014-04-04 07:52:44 +00:00

64 lines
1.5 KiB
Plaintext

# 2014 March 25.
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix sort3
# Sort roughly 20MB of data. Once with a mmap limit of 5MB and once without.
#
foreach {itest limit} {
1 5000000
2 0x7FFFFFFF
} {
sqlite3_test_control SQLITE_TESTCTRL_SORTER_MMAP db $limit
do_execsql_test 1.$itest {
WITH r(x,y) AS (
SELECT 1, randomblob(1000)
UNION ALL
SELECT x+1, randomblob(1000) FROM r
LIMIT 20000
)
SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
} {
4000 4000000
4000 4000000
4000 4000000
4000 4000000
4000 4000000
}
}
# Sort more than 2GB of data. At one point this was causing a problem.
# This test might take one minute or more to run.
#
do_execsql_test 2 {
PRAGMA cache_size = 20000;
WITH r(x,y) AS (
SELECT 1, randomblob(1000)
UNION ALL
SELECT x+1, randomblob(1000) FROM r
LIMIT 2200000
)
SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5);
} {
440000 440000000
440000 440000000
440000 440000000
440000 440000000
440000 440000000
}
finish_test