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 #***********************************************************************
13 source [file join [file dirname [info script]] rbu_common.tcl]
14 if_no_rbu_support { finish_test ; return }
15 set ::testprefix rbucollate
17 ifcapable !icu_collations {
22 # Create a simple RBU database. That expects to write to a table:
24 # CREATE TABLE t1(a PRIMARY KEY, b, c);
26 proc create_rbu1 {filename} {
28 sqlite3 rbu1 $filename
30 CREATE TABLE data_t1(a, b, c, rbu_control);
31 INSERT INTO data_t1 VALUES('a', 'one', 1, 0);
32 INSERT INTO data_t1 VALUES('b', 'two', 2, 0);
33 INSERT INTO data_t1 VALUES('c', 'three', 3, 0);
40 SELECT icu_load_collation('en_US', 'my-collate');
41 CREATE TABLE t1(a COLLATE "my-collate" PRIMARY KEY, b, c);
45 create_rbu1 testrbu.db
46 sqlite3rbu rbu test.db testrbu.db
47 rbu dbMain_eval { SELECT icu_load_collation('en_US', 'my-collate') }
48 rbu dbRbu_eval { SELECT icu_load_collation('en_US', 'my-collate') }
51 if {$rc!="SQLITE_OK"} break
54 db eval { SELECT * FROM t1 }
55 } {a one 1 b two 2 c three 3}
57 #forcedelete testrbu.db