SQLite

Check-in [95ecb2745f]
Login

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

Overview
Comment:Modification to schema.test so that it works with SQLITE_OMIT_TRIGGER and SQLITE_OMIT_UTF16 defined. (CVS 2285)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 95ecb2745f3fc69d370fc3961800db56297acb68
User & Date: danielk1977 2005-01-29 01:54:18.000
Context
2005-01-29
08:32
Modify sub-query handling. Tickets #1083 and #1084. (CVS 2286) (check-in: b1b50f3158 user: danielk1977 tags: trunk)
01:54
Modification to schema.test so that it works with SQLITE_OMIT_TRIGGER and SQLITE_OMIT_UTF16 defined. (CVS 2285) (check-in: 95ecb2745f user: danielk1977 tags: trunk)
2005-01-28
01:29
Make sure the #include of "sqliteInt.h" always comes first in C source files. (CVS 2284) (check-in: 522c094f79 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/schema.test.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file tests the various conditions under which an SQLITE_SCHEMA
# error should be returned.
#
# $Id: schema.test,v 1.3 2005/01/25 04:27:55 danielk1977 Exp $

#---------------------------------------------------------------------
# When any of the following types of SQL statements or actions are 
# executed, all pre-compiled statements are invalidated. An attempt
# to execute an invalidated statement always returns SQLITE_SCHEMA.
#
# CREATE/DROP TABLE...................................schema-1.*







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file tests the various conditions under which an SQLITE_SCHEMA
# error should be returned.
#
# $Id: schema.test,v 1.4 2005/01/29 01:54:18 danielk1977 Exp $

#---------------------------------------------------------------------
# When any of the following types of SQL statements or actions are 
# executed, all pre-compiled statements are invalidated. An attempt
# to execute an invalidated statement always returns SQLITE_SCHEMA.
#
# CREATE/DROP TABLE...................................schema-1.*
112
113
114
115
116
117
118



119
120
121
122
123
124
125
  } {SQLITE_ERROR}
  do_test schema-3.4 {
    sqlite3_finalize $::STMT
  } {SQLITE_SCHEMA}
}

do_test schema-4.1 {



  set ::STMT [sqlite3_prepare $::DB {SELECT * FROM sqlite_master} -1 TAIL]
  execsql {
    CREATE INDEX abc_index ON abc(a);
  }
  sqlite3_step $::STMT
} {SQLITE_ERROR}
do_test schema-4.2 {







>
>
>







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
  } {SQLITE_ERROR}
  do_test schema-3.4 {
    sqlite3_finalize $::STMT
  } {SQLITE_SCHEMA}
}

do_test schema-4.1 {
  catchsql {
    CREATE TABLE abc(a, b, c);
  }
  set ::STMT [sqlite3_prepare $::DB {SELECT * FROM sqlite_master} -1 TAIL]
  execsql {
    CREATE INDEX abc_index ON abc(a);
  }
  sqlite3_step $::STMT
} {SQLITE_ERROR}
do_test schema-4.2 {
181
182
183
184
185
186
187

188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203

204
205
206
207
208
209
210
  sqlite3_finalize $::STMT
} {SQLITE_SCHEMA}

#---------------------------------------------------------------------
# Tests 7.* check that prepared statements are invalidated when
# a collation sequence is deleted (but not when one is added).
#

do_test schema-7.1 {
  set sql {SELECT * FROM abc;}
  set ::STMT [sqlite3_prepare $::DB $sql -1 TAIL]
  add_test_collate $::DB 1 1 1
  sqlite3_step $::STMT
} {SQLITE_DONE}
do_test schema-7.2 {
  sqlite3_reset $::STMT
} {SQLITE_OK}
do_test schema-7.3 {
  add_test_collate $::DB 0 0 0 
  sqlite3_step $::STMT
} {SQLITE_ERROR}
do_test schema-7.4 {
  sqlite3_finalize $::STMT
} {SQLITE_SCHEMA}


#---------------------------------------------------------------------
# Tests 8.1 and 8.2 check that prepared statements are invalidated when
# the authorization function is set.
#
ifcapable auth {
  do_test schema-8.1 {







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







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
  sqlite3_finalize $::STMT
} {SQLITE_SCHEMA}

#---------------------------------------------------------------------
# Tests 7.* check that prepared statements are invalidated when
# a collation sequence is deleted (but not when one is added).
#
ifcapable utf16 {
  do_test schema-7.1 {
    set sql {SELECT * FROM abc;}
    set ::STMT [sqlite3_prepare $::DB $sql -1 TAIL]
    add_test_collate $::DB 1 1 1
    sqlite3_step $::STMT
  } {SQLITE_DONE}
  do_test schema-7.2 {
    sqlite3_reset $::STMT
  } {SQLITE_OK}
  do_test schema-7.3 {
    add_test_collate $::DB 0 0 0 
    sqlite3_step $::STMT
  } {SQLITE_ERROR}
  do_test schema-7.4 {
    sqlite3_finalize $::STMT
  } {SQLITE_SCHEMA}
}

#---------------------------------------------------------------------
# Tests 8.1 and 8.2 check that prepared statements are invalidated when
# the authorization function is set.
#
ifcapable auth {
  do_test schema-8.1 {