OLD | NEW |
1 # 2005 November 2 | 1 # 2005 November 2 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 INSERT INTO t4 VALUES(1,10); | 232 INSERT INTO t4 VALUES(1,10); |
233 SELECT * FROM t4 | 233 SELECT * FROM t4 |
234 } | 234 } |
235 } {1 10} | 235 } {1 10} |
236 do_test check-4.3 { | 236 do_test check-4.3 { |
237 execsql { | 237 execsql { |
238 UPDATE t4 SET x=4, y=3; | 238 UPDATE t4 SET x=4, y=3; |
239 SELECT * FROM t4 | 239 SELECT * FROM t4 |
240 } | 240 } |
241 } {4 3} | 241 } {4 3} |
242 do_test check-4.3 { | 242 do_test check-4.4 { |
243 execsql { | 243 execsql { |
244 UPDATE t4 SET x=12, y=2; | 244 UPDATE t4 SET x=12, y=2; |
245 SELECT * FROM t4 | 245 SELECT * FROM t4 |
246 } | 246 } |
247 } {12 2} | 247 } {12 2} |
248 do_test check-4.4 { | 248 do_test check-4.5 { |
249 execsql { | 249 execsql { |
250 UPDATE t4 SET x=12, y=-22; | 250 UPDATE t4 SET x=12, y=-22; |
251 SELECT * FROM t4 | 251 SELECT * FROM t4 |
252 } | 252 } |
253 } {12 -22} | 253 } {12 -22} |
254 do_test check-4.5 { | 254 do_test check-4.6 { |
255 catchsql { | 255 catchsql { |
256 UPDATE t4 SET x=0, y=1; | 256 UPDATE t4 SET x=0, y=1; |
257 } | 257 } |
258 } {1 {constraint failed}} | 258 } {1 {constraint failed}} |
259 do_test check-4.6 { | 259 do_test check-4.7 { |
260 execsql { | 260 execsql { |
261 SELECT * FROM t4; | 261 SELECT * FROM t4; |
262 } | 262 } |
263 } {12 -22} | 263 } {12 -22} |
264 do_test check-4.7 { | 264 do_test check-4.8 { |
265 execsql { | 265 execsql { |
266 PRAGMA ignore_check_constraints=ON; | 266 PRAGMA ignore_check_constraints=ON; |
267 UPDATE t4 SET x=0, y=1; | 267 UPDATE t4 SET x=0, y=1; |
268 SELECT * FROM t4; | 268 SELECT * FROM t4; |
269 } | 269 } |
270 } {0 1} | 270 } {0 1} |
271 do_test check-4.8 { | 271 do_test check-4.9 { |
272 catchsql { | 272 catchsql { |
273 PRAGMA ignore_check_constraints=OFF; | 273 PRAGMA ignore_check_constraints=OFF; |
274 UPDATE t4 SET x=0, y=2; | 274 UPDATE t4 SET x=0, y=2; |
275 } | 275 } |
276 } {1 {constraint failed}} | 276 } {1 {constraint failed}} |
277 ifcapable vacuum { | 277 ifcapable vacuum { |
278 do_test check_4.9 { | 278 do_test check_4.10 { |
279 catchsql { | 279 catchsql { |
280 VACUUM | 280 VACUUM |
281 } | 281 } |
282 } {0 {}} | 282 } {0 {}} |
283 } | 283 } |
284 | 284 |
285 do_test check-5.1 { | 285 do_test check-5.1 { |
286 catchsql { | 286 catchsql { |
287 CREATE TABLE t5(x, y, | 287 CREATE TABLE t5(x, y, |
288 CHECK( x*y<:abc ) | 288 CHECK( x*y<:abc ) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 365 } |
366 } {0 {}} | 366 } {0 {}} |
367 do_test check-6.15 { | 367 do_test check-6.15 { |
368 execsql {SELECT * FROM t1} | 368 execsql {SELECT * FROM t1} |
369 } {3 12.0 2 20.0} | 369 } {3 12.0 2 20.0} |
370 | 370 |
371 | 371 |
372 } | 372 } |
373 | 373 |
374 finish_test | 374 finish_test |
OLD | NEW |