add testing section to the readme
[sqlcipher.git] / test / tkt-18458b1a.test
blob4a6127485939669f86571208269deea84e5de69c
1 # 2019 September 10
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. In particular,
12 # that problems related to ticket [18458b1a] have been fixed.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix tkt-18458b1a
19 foreach tn {1 2} {
20   reset_db
21   if {$tn==1} {
22     # Disable the flattener and push-down optimizations
23     optimization_control db query-flattener 0
24     optimization_control db push-down 0
25   } else {
26     # Enable them
27     optimization_control db query-flattener 1
28     optimization_control db push-down 1
29   }
31   db cache size 0
33   do_execsql_test $tn.1.1 {
34     CREATE TABLE t0(c0 COLLATE NOCASE);
35     INSERT INTO t0(c0) VALUES ('B');
36     CREATE VIEW v0(c0, c1) AS SELECT DISTINCT t0.c0, 'a' FROM t0;
37   } 
39   do_execsql_test $tn.1.2 {
40     SELECT count(*) FROM v0 WHERE c1 >= c0;
41   } 1
43   do_execsql_test $tn.1.3 {
44     SELECT count(*) FROM v0 WHERE NOT NOT (c1 >= c0);
45   } 1
47   do_execsql_test $tn.1.4 {
48     SELECT count(*) FROM v0 WHERE ((c1 >= c0) OR 0+0);
49   } 1
52 finish_test