OLD | NEW |
1 # 2014 March 25. | 1 # 2014 March 25. |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
11 # This file implements regression tests for SQLite library. | 11 # This file implements regression tests for SQLite library. |
12 # | 12 # |
13 # Specifically, the tests in this file attempt to verify that | 13 # Specifically, the tests in this file attempt to verify that |
14 # multi-threaded sorting works. | 14 # multi-threaded sorting works. |
15 # | 15 # |
16 | 16 |
17 set testdir [file dirname $argv0] | 17 set testdir [file dirname $argv0] |
18 source $testdir/tester.tcl | 18 source $testdir/tester.tcl |
19 set testprefix sort2 | 19 set testprefix sort2 |
| 20 db close |
| 21 sqlite3_shutdown |
| 22 sqlite3_config_pmasz 10 |
| 23 sqlite3_initialize |
| 24 sqlite3 db test.db |
20 | 25 |
21 foreach {tn script} { | 26 foreach {tn script} { |
22 1 { } | 27 1 { } |
23 2 { | 28 2 { |
24 catch { db close } | 29 catch { db close } |
25 reset_db | 30 reset_db |
26 catch { db eval {PRAGMA threads=7} } | 31 catch { db eval {PRAGMA threads=7} } |
27 } | 32 } |
28 } { | 33 } { |
29 | 34 |
(...skipping 25 matching lines...) Expand all Loading... |
55 do_execsql_test $tn.2.2 { | 60 do_execsql_test $tn.2.2 { |
56 CREATE UNIQUE INDEX i1 ON t1(b, a); | 61 CREATE UNIQUE INDEX i1 ON t1(b, a); |
57 } | 62 } |
58 | 63 |
59 do_execsql_test $tn.2.3 { | 64 do_execsql_test $tn.2.3 { |
60 CREATE UNIQUE INDEX i2 ON t1(a); | 65 CREATE UNIQUE INDEX i2 ON t1(a); |
61 } | 66 } |
62 | 67 |
63 do_execsql_test $tn.2.4 { PRAGMA integrity_check } {ok} | 68 do_execsql_test $tn.2.4 { PRAGMA integrity_check } {ok} |
64 | 69 |
65 breakpoint | |
66 do_execsql_test $tn.3 { | 70 do_execsql_test $tn.3 { |
67 PRAGMA cache_size = 5; | 71 PRAGMA cache_size = 5; |
68 WITH r(x,y) AS ( | 72 WITH r(x,y) AS ( |
69 SELECT 1, randomblob(100) | 73 SELECT 1, randomblob(100) |
70 UNION ALL | 74 UNION ALL |
71 SELECT x+1, randomblob(100) FROM r | 75 SELECT x+1, randomblob(100) FROM r |
72 LIMIT 1000000 | 76 LIMIT 1000000 |
73 ) | 77 ) |
74 SELECT count(x), length(y) FROM r GROUP BY (x%5) | 78 SELECT count(x), length(y) FROM r GROUP BY (x%5) |
75 } { | 79 } { |
76 200000 100 200000 100 200000 100 200000 100 200000 100 | 80 200000 100 200000 100 200000 100 200000 100 200000 100 |
77 } | 81 } |
78 } | 82 } |
79 | 83 |
80 finish_test | 84 finish_test |
OLD | NEW |