/ Check-in [29972f74]
Login

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

Overview
Comment:Add a testcase for ticket #3810. (CVS 6955)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 29972f7445cede64d99c2433742572120c92b393
User & Date: drh 2009-08-01 15:54:26
Context
2009-08-01
16:27
Return a better error message when problems are encountered parsing a TEMP trigger or TEMP view that references objects in other databases that have been modified or dropped. Ticket #3810. (CVS 6956) check-in: 102785b9 user: drh tags: trunk
15:54
Add a testcase for ticket #3810. (CVS 6955) check-in: 29972f74 user: drh tags: trunk
15:09
Fix a segfault following OOM that was introduced by check-in (6949) which was a fix for ticket #3997. (CVS 6954) check-in: 359d78e1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added test/tkt3810.test.

            1  +# 2009 August 1
            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  +# Tests to make sure #3810 is fixed.
           13  +#
           14  +# $Id: tkt3810.test,v 1.1 2009/08/01 15:54:26 drh Exp $
           15  +
           16  +set testdir [file dirname $argv0]
           17  +source $testdir/tester.tcl
           18  +
           19  +# Create a table using the first database connection.
           20  +#
           21  +do_test tkt3810-1 {
           22  +  execsql {
           23  +    CREATE TABLE t1(x);
           24  +    INSERT INTO t1 VALUES(123);
           25  +    SELECT * FROM t1;
           26  +  }
           27  +} 123
           28  +
           29  +# Create a second connection to the same database.  Make sure the
           30  +# schema of the database has been parsed by the second connection.
           31  +#
           32  +do_test tkt3810-2 {
           33  +  sqlite3 db2 test.db
           34  +  execsql {
           35  +    SELECT * FROM t1;
           36  +  } db2
           37  +} 123
           38  +
           39  +# DROP the table using the second connection.  The table no longer exists
           40  +# but the first connection does not yet know this.  Then try to create a TEMP
           41  +# trigger in the first connection that references the table that was dropped.
           42  +#
           43  +do_test tkt3810-3 {
           44  +  execsql {DROP TABLE t1} db2
           45  +  execsql {
           46  +     CREATE TEMP TRIGGER r1 AFTER INSERT ON t1 BEGIN
           47  +       INSERT INTO t1 VALUES(2345);
           48  +     END;
           49  +     SELECT * FROM t1;
           50  +  }
           51  +} {}
           52  +
           53  +finish_test