xref: /sqlite-3.40.0/test/sort2.test (revision 578e1ca8)
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
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16set testprefix sort2
17
18db close
19sqlite3_shutdown
20sqlite3_config_worker_threads 7
21reset_db
22
23do_execsql_test 1 {
24  PRAGMA cache_size = 5;
25  WITH r(x,y) AS (
26    SELECT 1, randomblob(100)
27    UNION ALL
28    SELECT x+1, randomblob(100) FROM r
29    LIMIT 100000
30  )
31  SELECT count(x), length(y) FROM r GROUP BY (x%5)
32} {
33  20000 100 20000 100 20000 100 20000 100 20000 100
34}
35
36db close
37sqlite3_shutdown
38sqlite3_config_worker_threads 0
39sqlite3_initialize
40finish_test
41
42