Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: third_party/sqlite/src/test/memdb.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/manydb.test ('k') | third_party/sqlite/src/test/memsubsys1.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2001 September 15 1 # 2001 September 15
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 14 {} {} {UPDATE OR FAIL} 1 {6 7 3 4} 1 233 14 {} {} {UPDATE OR FAIL} 1 {6 7 3 4} 1
234 15 {} {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 234 15 {} {} {UPDATE OR ABORT} 1 {1 2 3 4} 1
235 16 {} {} {UPDATE OR ROLLBACK} 1 {1 2 3 4} 0 235 16 {} {} {UPDATE OR ROLLBACK} 1 {1 2 3 4} 0
236 } { 236 } {
237 # All tests after test 1 depend on conflict resolution. So end the 237 # All tests after test 1 depend on conflict resolution. So end the
238 # loop if that is not available in this build. 238 # loop if that is not available in this build.
239 ifcapable !conflict { 239 ifcapable !conflict {
240 if {$i>1} break 240 if {$i>1} break
241 } 241 }
242 242
243 if {$t0} {set t1 {column a is not unique}} 243 if {$t0} {set t1 {UNIQUE constraint failed: t1.a}}
244 do_test memdb-5.$i { 244 do_test memdb-5.$i {
245 if {$conf1!=""} {set conf1 "ON CONFLICT $conf1"} 245 if {$conf1!=""} {set conf1 "ON CONFLICT $conf1"}
246 if {$conf2!=""} {set conf2 "ON CONFLICT $conf2"} 246 if {$conf2!=""} {set conf2 "ON CONFLICT $conf2"}
247 set r0 [catch {execsql " 247 set r0 [catch {execsql "
248 DROP TABLE t1; 248 DROP TABLE t1;
249 CREATE TABLE t1(a,b,c, UNIQUE(a) $conf1); 249 CREATE TABLE t1(a,b,c, UNIQUE(a) $conf1);
250 INSERT INTO t1 SELECT * FROM t2; 250 INSERT INTO t1 SELECT * FROM t2;
251 UPDATE t3 SET x=0; 251 UPDATE t3 SET x=0;
252 BEGIN $conf2; 252 BEGIN $conf2;
253 $cmd t3 SET x=1; 253 $cmd t3 SET x=1;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 do_test memdb-6.15 { 359 do_test memdb-6.15 {
360 execsql { 360 execsql {
361 DELETE FROM t5 WHERE x>0; 361 DELETE FROM t5 WHERE x>0;
362 SELECT * FROM t5; 362 SELECT * FROM t5;
363 } 363 }
364 } {} 364 } {}
365 365
366 ifcapable subquery&&vtab { 366 ifcapable subquery&&vtab {
367 do_test memdb-7.1 { 367 do_test memdb-7.1 {
368 register_wholenumber_module db 368 load_static_extension db wholenumber
369 execsql { 369 execsql {
370 CREATE TABLE t6(x); 370 CREATE TABLE t6(x);
371 CREATE VIRTUAL TABLE nums USING wholenumber; 371 CREATE VIRTUAL TABLE nums USING wholenumber;
372 INSERT INTO t6 SELECT value FROM nums WHERE value BETWEEN 1 AND 256; 372 INSERT INTO t6 SELECT value FROM nums WHERE value BETWEEN 1 AND 256;
373 SELECT count(*) FROM (SELECT DISTINCT x FROM t6); 373 SELECT count(*) FROM (SELECT DISTINCT x FROM t6);
374 } 374 }
375 } {256} 375 } {256}
376 for {set i 1} {$i<=256} {incr i} { 376 for {set i 1} {$i<=256} {incr i} {
377 do_test memdb-7.2.$i { 377 do_test memdb-7.2.$i {
378 execsql "DELETE FROM t6 WHERE x=\ 378 execsql "DELETE FROM t6 WHERE x=\
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 set pgovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 1] 423 set pgovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 1]
424 execsql { DELETE FROM t1 } 424 execsql { DELETE FROM t1 }
425 set memused2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] 425 set memused2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1]
426 expr {($memused2 + 2048 < $memused) || $pgovfl==0} 426 expr {($memused2 + 2048 < $memused) || $pgovfl==0}
427 } {1} 427 } {1}
428 } 428 }
429 429
430 } ;# ifcapable memorydb 430 } ;# ifcapable memorydb
431 431
432 finish_test 432 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/manydb.test ('k') | third_party/sqlite/src/test/memsubsys1.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698