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. The
12 # focus of this file is testing optimizations associated with "IS NULL"
13 # and "IS NOT NULL" operators on columns with NOT NULL constraints.
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 set testprefix notnullfault
21 CREATE TABLE t1(a, b);
22 CREATE TABLE t2(c, d NOT NULL);
24 faultsim_save_and_close
26 do_faultsim_test 1 -prep {
27 faultsim_restore_and_reopen
30 SELECT * FROM t2 WHERE d NOT NULL
33 faultsim_test_result {0 {}}
36 #-------------------------------------------------------------------------
39 CREATE TABLE t1(a, b, c);
40 CREATE TABLE t2(a, b, c, PRIMARY KEY(a, b, c)) WITHOUT ROWID;
42 faultsim_save_and_close
44 do_faultsim_test 2.1 -faults oom-t* -prep {
45 faultsim_restore_and_reopen
48 SELECT dense_rank() OVER win FROM t2
49 WINDOW win AS (ORDER BY c IS NULL)
52 faultsim_test_result {0 {}}