Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/rbu/rbusplit.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / rbu / rbusplit.test` 93 lines ยท 2286 bytes Raw Blame History 1 # 2018 April 28 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 # 13 14 source [file join [file dirname [info script]] rbu_common.tcl] 15 if_no_rbu_support { finish_test ; return } 16 set ::testprefix rbusplit 17 18 db close 19 20 autoinstall_test_functions 21 22 proc build_db {db} { 23 $db eval { 24 CREATE TABLE t1(a PRIMARY KEY, b, c); 25 CREATE TABLE t2(a PRIMARY KEY, b, c); 26 27 CREATE INDEX t1c ON t1(c); 28 } 29 } 30 31 proc build_rbu {filename} { 32 forcedelete $filename 33 sqlite3 dbRbu $filename 34 dbRbu eval { 35 CREATE TABLE data0_t1(a, b, c, rbu_control); 36 CREATE TABLE data1_t1(a, b, c, rbu_control); 37 CREATE TABLE data2_t1(a, b, c, rbu_control); 38 CREATE TABLE data3_t1(a, b, c, rbu_control); 39 40 CREATE TABLE data_t2(a, b, c, rbu_control); 41 42 INSERT INTO data0_t1 VALUES(1, 1, 1, 0); 43 INSERT INTO data0_t1 VALUES(2, 2, 2, 0); 44 INSERT INTO data0_t1 VALUES(3, 3, 3, 0); 45 INSERT INTO data0_t1 VALUES(4, 4, 4, 0); 46 INSERT INTO data1_t1 VALUES(5, 5, 5, 0); 47 INSERT INTO data1_t1 VALUES(6, 6, 6, 0); 48 INSERT INTO data1_t1 VALUES(7, 7, 7, 0); 49 INSERT INTO data1_t1 VALUES(8, 8, 8, 0); 50 INSERT INTO data3_t1 VALUES(9, 9, 9, 0); 51 52 INSERT INTO data_t2 VALUES(1, 1, 1, 0); 53 INSERT INTO data_t2 VALUES(2, 2, 2, 0); 54 INSERT INTO data_t2 VALUES(3, 3, 3, 0); 55 INSERT INTO data_t2 VALUES(4, 4, 4, 0); 56 INSERT INTO data_t2 VALUES(5, 5, 5, 0); 57 INSERT INTO data_t2 VALUES(6, 6, 6, 0); 58 INSERT INTO data_t2 VALUES(7, 7, 7, 0); 59 INSERT INTO data_t2 VALUES(8, 8, 8, 0); 60 INSERT INTO data_t2 VALUES(9, 9, 9, 0); 61 } 62 63 dbRbu close 64 } 65 66 foreach {tn cmd} { 67 1 run_rbu 68 2 step_rbu 69 } { 70 reset_db 71 build_db db 72 build_rbu testrbu.db 73 74 do_test 1.$tn.1 { 75 $cmd test.db testrbu.db 76 } {SQLITE_DONE} 77 do_execsql_test 1.$tn.1 { 78 SELECT * FROM t1; 79 } { 80 1 1 1 2 2 2 3 3 3 4 4 4 81 5 5 5 6 6 6 7 7 7 8 8 8 82 9 9 9 83 } 84 do_execsql_test 1.$tn.2 { 85 SELECT * FROM t2; 86 } { 87 1 1 1 2 2 2 3 3 3 4 4 4 88 5 5 5 6 6 6 7 7 7 8 8 8 89 9 9 9 90 } 91 } 92 93 finish_test