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

Side by Side Diff: third_party/sqlite/sqlite-src-3170000/ext/rbu/rbu8.test

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: 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
OLDNEW
(Empty)
1 # 2014 November 20
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
9 #
10 #***********************************************************************
11 #
12 # Test the rbu_delta() feature.
13 #
14
15 if {![info exists testdir]} {
16 set testdir [file join [file dirname [info script]] .. .. test]
17 }
18 source $testdir/tester.tcl
19 set ::testprefix rbu8
20
21 do_execsql_test 1.0 {
22 CREATE TABLE t1(x, y PRIMARY KEY, z);
23 INSERT INTO t1 VALUES(NULL, 1, 'one');
24 INSERT INTO t1 VALUES(NULL, 2, 'two');
25 INSERT INTO t1 VALUES(NULL, 3, 'three');
26 CREATE INDEX i1z ON t1(z, x);
27 }
28
29 do_test 1.1 {
30 forcedelete rbu.db
31 sqlite3 db2 rbu.db
32 db2 eval {
33 CREATE TABLE data_t1(x, y, z, rbu_control);
34 INSERT INTO data_t1 VALUES('a', 1, '_i' , 'x.d');
35 INSERT INTO data_t1 VALUES('b', 2, 2 , '..x');
36 INSERT INTO data_t1 VALUES('_iii', 3, '-III' , 'd.d');
37 }
38 db2 close
39 } {}
40
41 do_test 1.2.1 {
42 sqlite3rbu rbu test.db rbu.db
43 rbu step
44 } {SQLITE_ERROR}
45 do_test 1.2.2 {
46 list [catch {rbu close} msg] $msg
47 } {1 {SQLITE_ERROR - no such function: rbu_delta}}
48
49 proc rbu_delta {orig new} {
50 return "${orig}${new}"
51 }
52
53 do_test 1.3.1 {
54 while 1 {
55 sqlite3rbu rbu test.db rbu.db
56 rbu create_rbu_delta
57 set rc [rbu step]
58 if {$rc != "SQLITE_OK"} break
59 rbu close
60 }
61 rbu close
62 } {SQLITE_DONE}
63
64 do_execsql_test 1.3.2 {
65 SELECT * FROM t1
66 } {
67 a 1 one_i
68 {} 2 2
69 _iii 3 three-III
70 }
71 integrity_check 1.3.3
72
73
74 finish_test
75
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/ext/rbu/rbu7.test ('k') | third_party/sqlite/sqlite-src-3170000/ext/rbu/rbu9.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698