Run shell*.test modules with "make mdevtest".
[sqlite.git] / test / filterfault.test
bloba8cde1f555ab3394af43b1de6674c85083541471
1 # 2018 May 8
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.
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16 set testprefix filterfault
18 ifcapable !windowfunc {
19   finish_test
20   return
23 do_execsql_test 1.0 {
24   CREATE TABLE t1(a, b, c, d);
25   INSERT INTO t1 VALUES(1, 2, 3, 4);
26   INSERT INTO t1 VALUES(5, 6, 7, 8);
27   INSERT INTO t1 VALUES(9, 10, 11, 12);
29 faultsim_save_and_close
31 do_faultsim_test 1 -faults oom-t* -prep {
32   faultsim_restore_and_reopen
33 } -body {
34   execsql {
35     SELECT sum(a) FILTER (WHERE b<5),
36            count() FILTER (WHERE d!=c) 
37       FROM t1 GROUP BY c ORDER BY 1;
38   }
39 } -test {
40   faultsim_test_result {0 {{} 1 {} 1 1 1}}
44 finish_test