3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
12 # This file contains tests for the RBU module.
16 source [file join [file dirname [info script]] rbu_common.tcl]
17 if_no_rbu_support { finish_test ; return }
22 # 1.*: That affinities are correctly applied to values within the
25 # 2.*: Tests for multi-column primary keys.
30 CREATE TABLE t1(a INT PRIMARY KEY, b) WITHOUT ROWID;
31 INSERT INTO t1 VALUES(1, 'abc');
32 INSERT INTO t1 VALUES(2, 'def');
38 CREATE TABLE data_t1(a, b, rbu_control);
39 INSERT INTO data_t1 VALUES('1', NULL, 1);
45 sqlite3rbu rbu test.db rbu.db
46 while { [rbu step]=="SQLITE_OK" } {}
55 #-------------------------------------------------------------------------
58 1 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, b)) WITHOUT ROWID }
59 2 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, b)) }
64 do_execsql_test 2.$tn.1 {
65 CREATE INDEX t1c ON t1(c);
66 INSERT INTO t1 VALUES(1, 1, 'a');
67 INSERT INTO t1 VALUES(1, 2, 'b');
68 INSERT INTO t1 VALUES(2, 1, 'c');
69 INSERT INTO t1 VALUES(2, 2, 'd');
76 CREATE TABLE data_t1(a, b, c, rbu_control);
77 INSERT INTO data_t1 VALUES(3, 1, 'e', 0);
78 INSERT INTO data_t1 VALUES(3, 2, 'f', 0);
79 INSERT INTO data_t1 VALUES(1, 2, NULL, 1);
80 INSERT INTO data_t1 VALUES(2, 1, 'X', '..x');
87 while {$rc == "SQLITE_OK"} {
88 sqlite3rbu rbu test.db rbu.db
95 do_execsql_test 2.$tn.1 {
96 SELECT * FROM t1 ORDER BY a, b