SQLite

Check-in [29972f7445]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 29972f7445cede64d99c2433742572120c92b393
User & Date: drh 2009-08-01 15:54:26.000
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: 102785b9fb user: drh tags: trunk)
15:54
Add a testcase for ticket #3810. (CVS 6955) (check-in: 29972f7445 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: 359d78e144 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Added test/tkt3810.test.










































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 2009 August 1
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# Tests to make sure #3810 is fixed.
#
# $Id: tkt3810.test,v 1.1 2009/08/01 15:54:26 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Create a table using the first database connection.
#
do_test tkt3810-1 {
  execsql {
    CREATE TABLE t1(x);
    INSERT INTO t1 VALUES(123);
    SELECT * FROM t1;
  }
} 123

# Create a second connection to the same database.  Make sure the
# schema of the database has been parsed by the second connection.
#
do_test tkt3810-2 {
  sqlite3 db2 test.db
  execsql {
    SELECT * FROM t1;
  } db2
} 123

# DROP the table using the second connection.  The table no longer exists
# but the first connection does not yet know this.  Then try to create a TEMP
# trigger in the first connection that references the table that was dropped.
#
do_test tkt3810-3 {
  execsql {DROP TABLE t1} db2
  execsql {
     CREATE TEMP TRIGGER r1 AFTER INSERT ON t1 BEGIN
       INSERT INTO t1 VALUES(2345);
     END;
     SELECT * FROM t1;
  }
} {}

finish_test