/ Check-in [e10d229f]
Login

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

Overview
Comment:Add a couple of extra test cases for #1644. (CVS 3037)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e10d229ff21ac884dda24f0ff936aaeb36ff9a3f
User & Date: danielk1977 2006-01-30 15:41:53
Context
2006-01-30
16:20
Documentation updates in preparation for the release of 3.3.3 stable. (CVS 3038) check-in: 6537b571 user: drh tags: trunk
15:41
Add a couple of extra test cases for #1644. (CVS 3037) check-in: e10d229f user: danielk1977 tags: trunk
15:34
Expire all prepared statements whenever there is a change to the schema of the TEMP database. Ticket #1644. (CVS 3036) check-in: 4cd4efaf user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/tkt1644.test.

15
16
17
18
19
20
21




22
23
24
25
26
27
28
..
59
60
61
62
63
64
65
66




67



































68
# are not expired correctly as a result of changes to TEMP
# views and triggers.
#

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






# Create two tables T1 and T2 and make V1 point to T1.
do_test tkt1644-1.1 {
  execsql {
    CREATE TABLE t1(a);
    INSERT INTO t1 VALUES(1);
    CREATE TABLE t2(b);
................................................................................
  execsql {
    CREATE TEMP TABLE t1(x);
  }
  execsql {
    SELECT * FROM t1;
  }
} {}









































finish_test







>
>
>
>







 








>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# are not expired correctly as a result of changes to TEMP
# views and triggers.
#

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

ifcapable !tempdb {
  finish_test
  return
}  

# Create two tables T1 and T2 and make V1 point to T1.
do_test tkt1644-1.1 {
  execsql {
    CREATE TABLE t1(a);
    INSERT INTO t1 VALUES(1);
    CREATE TABLE t2(b);
................................................................................
  execsql {
    CREATE TEMP TABLE t1(x);
  }
  execsql {
    SELECT * FROM t1;
  }
} {}

ifcapable view {
  do_test tkt1644-2.1 {
    execsql {
      CREATE TEMP TABLE temp_t1(a, b);
    }
    set ::DB [sqlite3_connection_pointer db]
    set ::STMT [sqlite3_prepare $::DB "SELECT * FROM temp_t1" -1 DUMMY]
    execsql {
      DROP TABLE temp_t1;
    }
    list [sqlite3_step $::STMT] [sqlite3_finalize $::STMT]
  } {SQLITE_ERROR SQLITE_SCHEMA}
  
  do_test tkt1644-2.2 {
    execsql {
      CREATE TABLE real_t1(a, b);
      CREATE TEMP VIEW temp_v1 AS SELECT * FROM real_t1;
    }
    set ::DB [sqlite3_connection_pointer db]
    set ::STMT [sqlite3_prepare $::DB "SELECT * FROM temp_v1" -1 DUMMY]
    execsql {
      DROP VIEW temp_v1;
    }
    list [sqlite3_step $::STMT] [sqlite3_finalize $::STMT]
  } {SQLITE_ERROR SQLITE_SCHEMA}

  do_test tkt1644-2.3 {
    execsql {
      CREATE TEMP VIEW temp_v1 AS SELECT * FROM real_t1 LIMIT 10 OFFSET 10;
    }
    set ::DB [sqlite3_connection_pointer db]
    set ::STMT [sqlite3_prepare $::DB "SELECT * FROM temp_v1" -1 DUMMY]
    execsql {
      DROP VIEW temp_v1;
    }
    list [sqlite3_step $::STMT] [sqlite3_finalize $::STMT]
  } {SQLITE_ERROR SQLITE_SCHEMA}
}


finish_test