Enhance the command-line completion extension to return the names of
[sqlite.git] / test / tkt-9f2eb3abac.test
blob8411654cdde56384913fc7c7ebbdd113c4894b9f
2 # 2013 August 29
4 # The author disclaims copyright to this source code.  In place of
5 # a legal notice, here is a blessing:
7 #    May you do good and not evil.
8 #    May you find forgiveness for yourself and forgive others.
9 #    May you share freely, never taking more than you give.
11 #***********************************************************************
12 # This file implements regression tests for SQLite library.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 source $testdir/malloc_common.tcl
18 set ::testprefix tkt-9f2eb3abac
20 do_execsql_test 1.1 {
21   CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,d,e));
22   SELECT * FROM t1 WHERE a=? AND b=? AND c=? AND d=? AND e=?;
23 } {}
25 do_execsql_test 1.2 {
26   CREATE TABLE "a" (
27       "b" integer NOT NULL,
28       "c" integer NOT NULL,
29       PRIMARY KEY ("b", "c")
30       );
32   CREATE TABLE "d" (
33       "e" integer NOT NULL,
34       "g" integer NOT NULL,
35       "f" integer NOT NULL,
36       "h" integer NOT NULL,
37       "i" character(10) NOT NULL,
38       "j" int,
39       PRIMARY KEY ("e", "g", "f", "h")
40       );
42   CREATE TABLE "d_to_a" (
43       "f_e" integer NOT NULL,
44       "f_g" integer NOT NULL,
45       "f_f" integer NOT NULL,
46       "f_h" integer NOT NULL,
47       "t_b" integer NOT NULL,
48       "t_c" integer NOT NULL,
49       "r" character NOT NULL,
50       "s" integer,
51       PRIMARY KEY ("f_e", "f_g", "f_f", "f_h", "t_b", "t_c")
52       );
54   INSERT INTO d (g, e, h, f, j, i) VALUES ( 1, 1, 1, 1, 1, 1 );
55   INSERT INTO a (b, c) VALUES ( 1, 1 );
56   INSERT INTO d_to_a VALUES (1, 1, 1, 1, 1, 1, 1, 1);
58   DELETE FROM d_to_a 
59   WHERE f_g = 1 AND f_e = 1 AND f_h = 1 AND f_f = 1 AND t_b = 1 AND t_c = 1;
61   SELECT * FROM d_to_a;
62 } {}
64 faultsim_delete_and_reopen
65 do_execsql_test 2.0 { CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,d,e)) }
66 do_execsql_test 2.1 { CREATE TABLE t2(x) }
67 faultsim_save_and_close
69 do_faultsim_test 3 -faults oom* -prep {
70   faultsim_restore_and_reopen
71   execsql { SELECT 1 FROM sqlite_master }
72 } -body {
73   execsql { SELECT * FROM t1,t2 WHERE a=? AND b=? AND c=? AND d=? AND e=? }
74 } -test {
75   faultsim_test_result {0 {}} 
78 finish_test