xref: /sqlite-3.40.0/test/sortfault.test (revision 22ace891)
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 sortfault
17
18
19do_execsql_test 1.0 {
20  PRAGMA cache_size = 5;
21}
22
23do_faultsim_test 1 -prep {
24  sqlite3 db test.db
25} -body {
26  execsql {
27    WITH r(x,y) AS (
28      SELECT 1, randomblob(1000)
29      UNION ALL
30      SELECT x+1, randomblob(1000) FROM r
31      LIMIT 500
32    )
33    SELECT count(x), length(y) FROM r GROUP BY (x%5)
34  }
35} -test {
36  faultsim_test_result {0 {100 1000 100 1000 100 1000 100 1000 100 1000}}
37}
38
39finish_test
40
41