Enhance the command-line completion extension to return the names of
[sqlite.git] / test / tkt-4ef7e3cfca.test
blobfc1efdef666f967486c70cd7d307f40f87c10e99
1 # 2014-03-04
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 #***********************************************************************
12 # This file implements tests to verify that ticket [4ef7e3cfca] has been
13 # fixed.
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 set testprefix tkt-4ef7e3cfca
20 do_catchsql_test 1.1 {
21   CREATE TABLE x(a);
22   CREATE TRIGGER t AFTER INSERT ON x BEGIN
23     SELECT * FROM x WHERE abc.a = 1;
24   END;
25   INSERT INTO x VALUES('assert');
26 } {1 {no such column: abc.a}}
28 reset_db
29 do_execsql_test 2.1 {
30   CREATE TABLE w(a);
31   CREATE TABLE x(a);
32   CREATE TABLE y(a);
33   CREATE TABLE z(a);
35   INSERT INTO x(a) VALUES(5);
36   INSERT INTO y(a) VALUES(10);
38   CREATE TRIGGER t AFTER INSERT ON w BEGIN
39     INSERT INTO z
40     SELECT (SELECT x.a + y.a FROM y) FROM x;
41   END;
42   INSERT INTO w VALUES('incorrect');
44 do_execsql_test 2.2 {
45   SELECT * FROM z;
46 } {15}
48 reset_db
49 do_execsql_test 3.1 {
50   CREATE TABLE w(a);
51   CREATE TABLE x(b);
52   CREATE TABLE y(a);
53   CREATE TABLE z(a);
55   INSERT INTO x(b) VALUES(5);
56   INSERT INTO y(a) VALUES(10);
58   CREATE TRIGGER t AFTER INSERT ON w BEGIN
59     INSERT INTO z
60     SELECT (SELECT x.b + y.a FROM y) FROM x;
61   END;
62   INSERT INTO w VALUES('assert');
64 do_execsql_test 3.2 {
65   SELECT * FROM z;
66 } {15}
68 finish_test