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

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

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 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/autovacuum.test ('k') | third_party/sqlite/src/test/backup.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 # 2010 August 19 1 # 2010 August 19
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 proc sql2 sql { code2 [list db eval $sql] } 56 proc sql2 sql { code2 [list db eval $sql] }
57 57
58 code1 { sqlite3 db test.db } 58 code1 { sqlite3 db test.db }
59 code2 { sqlite3 db test.db } 59 code2 { sqlite3 db test.db }
60 60
61 foreach c {code1 code2} { 61 foreach c {code1 code2} {
62 $c { 62 $c {
63 set v [split [db version] .] 63 set v [split [db version] .]
64 if {[llength $v]==3} {lappend v 0} 64 if {[llength $v]==3} {lappend v 0}
65 set ::sqlite_libversion [format \ 65 set ::sqlite_libversion [format \
66 "%d%.2d%.2d%2d" [lindex $v 0] [lindex $v 1] [lindex $v 2] [lindex $v 3] 66 "%d%.2d%.2d%.2d" [lindex $v 0] [lindex $v 1] [lindex $v 2] [lindex $v 3]
67 ] 67 ]
68 } 68 }
69 } 69 }
70 70
71 uplevel $script 71 uplevel $script
72 72
73 catch { code1 { db close } } 73 catch { code1 { db close } }
74 catch { code2 { db close } } 74 catch { code2 { db close } }
75 catch { close $::bc_chan2 } 75 catch { close $::bc_chan2 }
76 catch { close $::bc_chan1 } 76 catch { close $::bc_chan1 }
77 77
78 78
79 } 79 }
80 80
81 array set ::incompatible [list] 81 array set ::incompatible [list]
82 proc do_allbackcompat_test {script} { 82 proc do_allbackcompat_test {script} {
83 83
84 foreach bin $::BC(binaries) { 84 foreach bin $::BC(binaries) {
85 set nErr [set_test_counter errors] 85 set nErr [set_test_counter errors]
86 foreach dir {0 1} { 86 foreach dir {0 1} {
87 87
88 set bintag [string map {testfixture {}} $bin] 88 set bintag $bin
89 regsub {.*testfixture\.} $bintag {} bintag
89 set bintag [string map {\.exe {}} $bintag] 90 set bintag [string map {\.exe {}} $bintag]
90 if {$bintag == ""} {set bintag self} 91 if {$bintag == ""} {set bintag self}
91 set ::bcname ".$bintag.$dir." 92 set ::bcname ".$bintag.$dir."
92 93
93 rename do_test _do_test 94 rename do_test _do_test
94 proc do_test {nm sql res} { 95 proc do_test {nm sql res} {
95 set nm [regsub {\.} $nm $::bcname] 96 set nm [regsub {\.} $nm $::bcname]
96 uplevel [list _do_test $nm $sql $res] 97 uplevel [list _do_test $nm $sql $res]
97 } 98 }
98 99
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 INSERT INTO t2 SELECT words FROM t1; 414 INSERT INTO t2 SELECT words FROM t1;
414 INSERT INTO t2 SELECT words FROM t1; 415 INSERT INTO t2 SELECT words FROM t1;
415 INSERT INTO t2 SELECT words FROM t1; 416 INSERT INTO t2 SELECT words FROM t1;
416 SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level; 417 SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level;
417 } 418 }
418 } {0 {0 1 2 3 4 5}} 419 } {0 {0 1 2 3 4 5}}
419 420
420 if {[code1 { set ::sqlite_libversion }] >=3071200 421 if {[code1 { set ::sqlite_libversion }] >=3071200
421 && [code2 { set ::sqlite_libversion }] >=3071200 422 && [code2 { set ::sqlite_libversion }] >=3071200
422 } { 423 } {
424 if {[code1 { set ::sqlite_libversion }]<3120000} {
425 set res {0 {0 1} 1 0}
426 } else {
427 set res {1 0}
428 }
429
423 do_test backcompat-3.9 { 430 do_test backcompat-3.9 {
424 sql1 { INSERT INTO t2(t2) VALUES('merge=100,4'); } 431 sql1 { INSERT INTO t2(t2) VALUES('merge=100,4'); }
425 sql2 { INSERT INTO t2(t2) VALUES('merge=100,4'); } 432 sql2 { INSERT INTO t2(t2) VALUES('merge=100,4'); }
426 sql1 { INSERT INTO t2(t2) VALUES('merge=100,4'); } 433 sql1 { INSERT INTO t2(t2) VALUES('merge=100,4'); }
427 sql2 { INSERT INTO t2(t2) VALUES('merge=2500,4'); } 434 sql2 { INSERT INTO t2(t2) VALUES('merge=2500,4'); }
428 sql2 { 435 sql2 {
429 SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level; 436 SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level;
430 } 437 }
431 } {0 {0 1} 1 0} 438 } $res
432 439
433 do_test backcompat-3.10 { 440 do_test backcompat-3.10 {
434 sql1 { INSERT INTO t2(t2) VALUES('integrity-check') } 441 sql1 { INSERT INTO t2(t2) VALUES('integrity-check') }
435 sql2 { INSERT INTO t2(t2) VALUES('integrity-check') } 442 sql2 { INSERT INTO t2(t2) VALUES('integrity-check') }
436 } {} 443 } {}
437 } 444 }
438 } 445 }
439 } 446 }
440 } 447 }
441 448
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 515
509 foreach {n q} $::queries { 516 foreach {n q} $::queries {
510 do_test backcompat-4.6.$n [list sql1 $q] [sql2 $q] 517 do_test backcompat-4.6.$n [list sql1 $q] [sql2 $q]
511 } 518 }
512 519
513 } 520 }
514 } 521 }
515 } 522 }
516 523
517 finish_test 524 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/autovacuum.test ('k') | third_party/sqlite/src/test/backup.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698