OLD | NEW |
1 # 2011 Aug 1 | 1 # 2011 Aug 1 |
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 # This file checks to make sure IS NOT NULL constraints work on | 12 # This file checks to make sure IS NOT NULL constraints work on |
13 # virtual tables. | 13 # virtual tables. |
14 # | 14 # |
15 | 15 |
16 set testdir [file dirname $argv0] | 16 set testdir [file dirname $argv0] |
17 source $testdir/tester.tcl | 17 source $testdir/tester.tcl |
18 | 18 |
19 ifcapable !vtab||!schema_pragmas { finish_test ; return } | 19 ifcapable !vtab||!schema_pragmas { finish_test ; return } |
20 | 20 |
21 # Register the echo module | 21 # Register the echo module |
22 register_echo_module [sqlite3_connection_pointer db] | 22 register_echo_module [sqlite3_connection_pointer db] |
23 | 23 |
24 do_test vtabE-1.1 { | 24 do_test vtabF-1.1 { |
25 execsql { | 25 execsql { |
26 CREATE TABLE t1(a, b); | 26 CREATE TABLE t1(a, b); |
27 CREATE INDEX i1 ON t1(a); | 27 CREATE INDEX i1 ON t1(a); |
28 CREATE INDEX i2 ON t1(b); | 28 CREATE INDEX i2 ON t1(b); |
29 INSERT INTO t1 VALUES(10,110); | 29 INSERT INTO t1 VALUES(10,110); |
30 INSERT INTO t1 VALUES(11,111); | 30 INSERT INTO t1 VALUES(11,111); |
31 INSERT INTO t1 SELECT a+2, b+2 FROM t1; | 31 INSERT INTO t1 SELECT a+2, b+2 FROM t1; |
32 INSERT INTO t1 SELECT null, b+4 FROM t1; | 32 INSERT INTO t1 SELECT null, b+4 FROM t1; |
33 INSERT INTO t1 SELECT null, b+8 FROM t1; | 33 INSERT INTO t1 SELECT null, b+8 FROM t1; |
34 INSERT INTO t1 SELECT null, b+16 FROM t1; | 34 INSERT INTO t1 SELECT null, b+16 FROM t1; |
35 ANALYZE; | 35 ANALYZE; |
36 CREATE VIRTUAL TABLE tv1 USING echo(t1); | 36 CREATE VIRTUAL TABLE tv1 USING echo(t1); |
37 SELECT b FROM t1 WHERE a IS NOT NULL; | 37 SELECT b FROM t1 WHERE a IS NOT NULL; |
38 } | 38 } |
39 } {110 111 112 113} | 39 } {110 111 112 113} |
40 do_test vtabE-1.2 { | 40 do_test vtabF-1.2 { |
41 execsql {SELECT b FROM tv1 WHERE a IS NOT NULL} | 41 execsql {SELECT b FROM tv1 WHERE a IS NOT NULL} |
42 } {110 111 112 113} | 42 } {110 111 112 113} |
43 | 43 |
44 | 44 |
45 finish_test | 45 finish_test |
OLD | NEW |