/ Check-in [b53a9a3d]
Login

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

Overview
Comment:Update some test cases to account for SQLITE_OMIT_VIRTUAL_TABLE builds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:b53a9a3dc6b0422a102b245451769b0cd8c0d67090fefabf7cb3a65137a73771
User & Date: dan 2018-11-28 11:49:46
Context
2018-11-28
19:12
Update incrvacuum.test so that it works with builds that do not support mmap(). check-in: 8eb62fd5 user: dan tags: trunk
11:49
Update some test cases to account for SQLITE_OMIT_VIRTUAL_TABLE builds. check-in: b53a9a3d user: dan tags: trunk
11:09
Follow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a new codec, not when overwriting an existing codec. Also, improve a comment in the pcache1 subsystem. check-in: 5c040fdb user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/attach.test.

722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
    catchsql {
      CREATE TRIGGER r5 AFTER INSERT ON t5 BEGIN
        DELETE FROM t1 WHERE x<(SELECT min(x) FROM temp.t6);
      END;
    } db2
  } {1 {trigger r5 cannot reference objects in database temp}}
} ;# endif subquery
ifcapable json1 {
  do_test attach-5.10 {
    db close
    catch {db2 close}
    forcedelete test.db
    sqlite3 db test.db
    db eval {
      CREATE TABLE t1(x);







|







722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
    catchsql {
      CREATE TRIGGER r5 AFTER INSERT ON t5 BEGIN
        DELETE FROM t1 WHERE x<(SELECT min(x) FROM temp.t6);
      END;
    } db2
  } {1 {trigger r5 cannot reference objects in database temp}}
} ;# endif subquery
ifcapable json1&&vtab {
  do_test attach-5.10 {
    db close
    catch {db2 close}
    forcedelete test.db
    sqlite3 db test.db
    db eval {
      CREATE TABLE t1(x);

Changes to test/indexexpr2.test.

197
198
199
200
201
202
203

204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232

233
  set ::cnt
  # Refcnt() should not be invoked because that index does not change.
} {0}

# Additional test cases to show that UPDATE does not modify indexes that
# do not involve unchanged columns.
#

load_static_extension db explain
do_execsql_test 4.200 {
  CREATE TABLE t2(a,b,c,d,e,f);
  INSERT INTO t2 VALUES(2,3,4,5,6,7);
  CREATE INDEX t2abc ON t2(a+b+c);
  CREATE INDEX t2cd ON t2(c*d);
  CREATE INDEX t2def ON t2(d,e+25*f);
  SELECT sqlite_master.name 
    FROM sqlite_master, explain('UPDATE t2 SET b=b+1')
   WHERE explain.opcode LIKE 'Open%'
     AND sqlite_master.rootpage=explain.p2
   ORDER BY 1;
} {t2 t2abc}
do_execsql_test 4.210 {
  SELECT sqlite_master.name 
    FROM sqlite_master, explain('UPDATE t2 SET c=c+1')
   WHERE explain.opcode LIKE 'Open%'
     AND sqlite_master.rootpage=explain.p2
   ORDER BY 1;
} {t2 t2abc t2cd}
do_execsql_test 4.220 {
  SELECT sqlite_master.name 
    FROM sqlite_master, explain('UPDATE t2 SET c=c+1, f=NULL')
   WHERE explain.opcode LIKE 'Open%'
     AND sqlite_master.rootpage=explain.p2
   ORDER BY 1;
} {t2 t2abc t2cd t2def}



finish_test







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

>

197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
  set ::cnt
  # Refcnt() should not be invoked because that index does not change.
} {0}

# Additional test cases to show that UPDATE does not modify indexes that
# do not involve unchanged columns.
#
ifcapable vtab {
  load_static_extension db explain
  do_execsql_test 4.200 {
    CREATE TABLE t2(a,b,c,d,e,f);
    INSERT INTO t2 VALUES(2,3,4,5,6,7);
    CREATE INDEX t2abc ON t2(a+b+c);
    CREATE INDEX t2cd ON t2(c*d);
    CREATE INDEX t2def ON t2(d,e+25*f);
    SELECT sqlite_master.name 
      FROM sqlite_master, explain('UPDATE t2 SET b=b+1')
     WHERE explain.opcode LIKE 'Open%'
       AND sqlite_master.rootpage=explain.p2
     ORDER BY 1;
  } {t2 t2abc}
  do_execsql_test 4.210 {
    SELECT sqlite_master.name 
      FROM sqlite_master, explain('UPDATE t2 SET c=c+1')
     WHERE explain.opcode LIKE 'Open%'
       AND sqlite_master.rootpage=explain.p2
     ORDER BY 1;
  } {t2 t2abc t2cd}
  do_execsql_test 4.220 {
    SELECT sqlite_master.name 
      FROM sqlite_master, explain('UPDATE t2 SET c=c+1, f=NULL')
     WHERE explain.opcode LIKE 'Open%'
       AND sqlite_master.rootpage=explain.p2
     ORDER BY 1;
  } {t2 t2abc t2cd t2def}
}


finish_test

Changes to test/pragma4.test.

130
131
132
133
134
135
136

137
138
139
140
141

142
143
144
145
146
147
148

149
150

151
152
153
154
155
156
157
158
159
160
161
162

163
164

165
166
167
168
169
170

171
172
173


174
175
176
177

178
179

180
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
211
reset_db
forcedelete test.db2
do_execsql_test 4.2.1 {
  CREATE TABLE t1(a, b, c);
  ATTACH 'test.db2' AS aux;
  CREATE TABLE aux.t2(d, e, f);
}

do_execsql_test 4.2.2 { SELECT * FROM pragma_table_info('t1') } {
  0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0
}
do_execsql_test 4.2.3 { SELECT * FROM pragma_table_info('t2') } {
  0 d {} 0 {} 0 1 e {} 0 {} 0 2 f {} 0 {} 0

}
do_test 4.2.4 { 
  sqlite3 db3 test.db
  sqlite3 db2 test.db2
  execsql { DROP TABLE t1 } db3
  execsql { DROP TABLE t2 } db2
} {}

do_execsql_test 4.2.5 { SELECT * FROM pragma_table_info('t1') } 
do_execsql_test 4.2.6 { SELECT * FROM pragma_table_info('t2') } 


db2 close
db3 close
reset_db
forcedelete test.db2
do_execsql_test 4.3.1 {
  CREATE TABLE t1(a, b, c);
  CREATE INDEX i1 ON t1(b);
  ATTACH 'test.db2' AS aux;
  CREATE TABLE aux.t2(d, e, f);
  CREATE INDEX aux.i2 ON t2(e);
}

do_execsql_test 4.3.2 { SELECT * FROM pragma_index_info('i1') } {0 1 b}
do_execsql_test 4.3.3 { SELECT * FROM pragma_index_info('i2') } {0 1 e}

do_test 4.3.4 { 
  sqlite3 db3 test.db
  sqlite3 db2 test.db2
  execsql { DROP INDEX i1 } db3
  execsql { DROP INDEX i2 } db2
} {}

do_execsql_test 4.3.5 { SELECT * FROM pragma_index_info('i1') } 
do_execsql_test 4.3.6 { SELECT * FROM pragma_index_info('i2') } 



do_execsql_test 4.4.0 {
  CREATE INDEX main.i1 ON t1(b, c);
  CREATE INDEX aux.i2 ON t2(e, f);
}

do_execsql_test 4.4.1 { SELECT * FROM pragma_index_list('t1') } {0 i1 0 c 0}
do_execsql_test 4.4.2 { SELECT * FROM pragma_index_list('t2') } {0 i2 0 c 0}

do_test 4.4.3 { 
  execsql { DROP INDEX i1 } db3
  execsql { DROP INDEX i2 } db2
} {}

do_execsql_test 4.4.5 { SELECT * FROM pragma_index_list('t1') } {}
do_execsql_test 4.4.6 { SELECT * FROM pragma_index_list('t2') } {}



do_execsql_test 4.5.0 {
  CREATE UNIQUE INDEX main.i1 ON t1(a);
  CREATE UNIQUE INDEX aux.i2 ON t2(d);
  CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
  CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
}

do_execsql_test 4.5.1 { SELECT * FROM pragma_foreign_key_list('c1') } {
  0 0 t1 c a {NO ACTION} {NO ACTION} NONE
}
do_execsql_test 4.5.2 { SELECT * FROM pragma_foreign_key_list('c2') } {
  0 0 t2 r d {NO ACTION} {NO ACTION} NONE

}
do_test 4.5.3 { 
  execsql { DROP TABLE c1 } db3
  execsql { DROP TABLE c2 } db2
} {}

do_execsql_test 4.5.1 { SELECT * FROM pragma_foreign_key_list('c1') }
do_execsql_test 4.5.2 { SELECT * FROM pragma_foreign_key_list('c2') } 



do_execsql_test 4.6.0 {
  CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
  CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
  INSERT INTO main.c1 VALUES(1, 2, 3);
  INSERT INTO aux.c2 VALUES(4, 5, 6);
}







>
|
|
|
|
|
>







>
|
|
>












>
|
|
>






>
|
|
|
>
>




>
|
|
>




>
|
|
>
>







>
|
|
|
|
|
>





>
|
|
>
>







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
reset_db
forcedelete test.db2
do_execsql_test 4.2.1 {
  CREATE TABLE t1(a, b, c);
  ATTACH 'test.db2' AS aux;
  CREATE TABLE aux.t2(d, e, f);
}
ifcapable vtab {
  do_execsql_test 4.2.2 { SELECT * FROM pragma_table_info('t1') } {
    0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0
  }
  do_execsql_test 4.2.3 { SELECT * FROM pragma_table_info('t2') } {
    0 d {} 0 {} 0 1 e {} 0 {} 0 2 f {} 0 {} 0
  }
}
do_test 4.2.4 { 
  sqlite3 db3 test.db
  sqlite3 db2 test.db2
  execsql { DROP TABLE t1 } db3
  execsql { DROP TABLE t2 } db2
} {}
ifcapable vtab {
  do_execsql_test 4.2.5 { SELECT * FROM pragma_table_info('t1') } 
  do_execsql_test 4.2.6 { SELECT * FROM pragma_table_info('t2') } 
}

db2 close
db3 close
reset_db
forcedelete test.db2
do_execsql_test 4.3.1 {
  CREATE TABLE t1(a, b, c);
  CREATE INDEX i1 ON t1(b);
  ATTACH 'test.db2' AS aux;
  CREATE TABLE aux.t2(d, e, f);
  CREATE INDEX aux.i2 ON t2(e);
}
ifcapable vtab {
  do_execsql_test 4.3.2 { SELECT * FROM pragma_index_info('i1') } {0 1 b}
  do_execsql_test 4.3.3 { SELECT * FROM pragma_index_info('i2') } {0 1 e}
}
do_test 4.3.4 { 
  sqlite3 db3 test.db
  sqlite3 db2 test.db2
  execsql { DROP INDEX i1 } db3
  execsql { DROP INDEX i2 } db2
} {}
ifcapable vtab {
  do_execsql_test 4.3.5 { SELECT * FROM pragma_index_info('i1') } 
  do_execsql_test 4.3.6 { SELECT * FROM pragma_index_info('i2') } 
}

execsql {SELECT * FROM main.sqlite_master, aux.sqlite_master}
do_execsql_test 4.4.0 {
  CREATE INDEX main.i1 ON t1(b, c);
  CREATE INDEX aux.i2 ON t2(e, f);
}
ifcapable vtab {
  do_execsql_test 4.4.1 { SELECT * FROM pragma_index_list('t1') } {0 i1 0 c 0}
  do_execsql_test 4.4.2 { SELECT * FROM pragma_index_list('t2') } {0 i2 0 c 0}
}
do_test 4.4.3 { 
  execsql { DROP INDEX i1 } db3
  execsql { DROP INDEX i2 } db2
} {}
ifcapable vtab {
  do_execsql_test 4.4.5 { SELECT * FROM pragma_index_list('t1') } {}
  do_execsql_test 4.4.6 { SELECT * FROM pragma_index_list('t2') } {}
}
execsql {SELECT * FROM main.sqlite_master, aux.sqlite_master}

do_execsql_test 4.5.0 {
  CREATE UNIQUE INDEX main.i1 ON t1(a);
  CREATE UNIQUE INDEX aux.i2 ON t2(d);
  CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
  CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
}
ifcapable vtab {
  do_execsql_test 4.5.1 { SELECT * FROM pragma_foreign_key_list('c1') } {
    0 0 t1 c a {NO ACTION} {NO ACTION} NONE
  }
  do_execsql_test 4.5.2 { SELECT * FROM pragma_foreign_key_list('c2') } {
    0 0 t2 r d {NO ACTION} {NO ACTION} NONE
  }
}
do_test 4.5.3 { 
  execsql { DROP TABLE c1 } db3
  execsql { DROP TABLE c2 } db2
} {}
ifcapable vtab {
  do_execsql_test 4.5.4 { SELECT * FROM pragma_foreign_key_list('c1') }
  do_execsql_test 4.5.5 { SELECT * FROM pragma_foreign_key_list('c2') } 
}
execsql {SELECT * FROM main.sqlite_master, aux.sqlite_master}

do_execsql_test 4.6.0 {
  CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
  CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
  INSERT INTO main.c1 VALUES(1, 2, 3);
  INSERT INTO aux.c2 VALUES(4, 5, 6);
}