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 # Specifically, the tests in this file attempt to verify that
14 # multi-threaded sorting works.
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
22 sqlite3_config_pmasz 10
31 catch { db eval {PRAGMA threads=7} }
36 do_execsql_test $tn.1 {
37 PRAGMA cache_size = 5;
39 SELECT 1, randomblob(100)
41 SELECT x+1, randomblob(100) FROM r
44 SELECT count(x), length(y) FROM r GROUP BY (x%5)
46 20000 100 20000 100 20000 100 20000 100 20000 100
49 do_execsql_test $tn.2.1 {
50 CREATE TABLE t1(a, b);
52 SELECT 1, randomblob(100)
54 SELECT x+1, randomblob(100) FROM r
56 ) INSERT INTO t1 SELECT * FROM r;
59 do_execsql_test $tn.2.2 {
60 CREATE UNIQUE INDEX i1 ON t1(b, a);
63 do_execsql_test $tn.2.3 {
64 CREATE UNIQUE INDEX i2 ON t1(a);
67 do_execsql_test $tn.2.4 { PRAGMA integrity_check } {ok}
69 # Because it uses so much data, this test can take 12-13 seconds even on
70 # a modern workstation. So it is omitted from "veryquick" and other
71 # permutations.test tests.
72 if {[isquick]==0 && [clang_sanitize_address]==0} {
73 do_execsql_test $tn.3 {
74 PRAGMA cache_size = 5;
76 SELECT 1, randomblob(100)
78 SELECT x+1, randomblob(100) FROM r
81 SELECT count(x), length(y) FROM r GROUP BY (x%5)
83 200000 100 200000 100 200000 100 200000 100 200000 100