/ Check-in [62410bb8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add tests to verify the fix for bug [4ef7e3cfca].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 62410bb8a7b33efcd13bce8fd75b83523922adb8
User & Date: dan 2014-03-04 11:35:20
Context
2014-03-04
11:54
Fix minor typos in the new test file. check-in: 3cbb9b1b user: mistachkin tags: trunk
11:35
Add tests to verify the fix for bug [4ef7e3cfca]. check-in: 62410bb8 user: dan tags: trunk
11:29
Fix name resolution problem in sub-selects within triggers, ticket [4ef7e3cfca]. check-in: 5bcd0b1c user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added test/tkt-4ef7e3cfca.test.

            1  +# 2013-10-30
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            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.
            9  +#
           10  +#***********************************************************************
           11  +#
           12  +# This file implements regression tests for SQLite library.  The
           13  +# focus of this file is testing WITHOUT ROWID tables.
           14  +#
           15  +
           16  +set testdir [file dirname $argv0]
           17  +source $testdir/tester.tcl
           18  +set testprefix tkt-4ef7e3cfca.test
           19  +
           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}}
           27  +
           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);
           34  +
           35  +  INSERT INTO x(a) VALUES(5);
           36  +  INSERT INTO y(a) VALUES(10);
           37  +
           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');
           43  +}
           44  +do_execsql_test 2.2 {
           45  +  SELECT * FROM z;
           46  +} {15}
           47  +
           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);
           54  +
           55  +  INSERT INTO x(b) VALUES(5);
           56  +  INSERT INTO y(a) VALUES(10);
           57  +
           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');
           63  +}
           64  +do_execsql_test 3.2 {
           65  +  SELECT * FROM z;
           66  +} {15}
           67  +
           68  +  
           69  +finish_test
           70  +
           71  +