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 implements tests to verify that ticket [cbd054fa6b] has been
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
26 binary scan $blob c* bytes
28 set t [binary format c $b]
29 if {[string is print $t]} {
39 do_test tkt-cbd05-1.1 {
41 CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT UNIQUE NOT NULL);
42 CREATE INDEX t1_x ON t1(b);
43 INSERT INTO t1 VALUES (NULL, '');
44 INSERT INTO t1 VALUES (NULL, 'A');
45 INSERT INTO t1 VALUES (NULL, 'B');
46 INSERT INTO t1 VALUES (NULL, 'C');
47 INSERT INTO t1 VALUES (NULL, 'D');
48 INSERT INTO t1 VALUES (NULL, 'E');
49 INSERT INTO t1 VALUES (NULL, 'F');
50 INSERT INTO t1 VALUES (NULL, 'G');
51 INSERT INTO t1 VALUES (NULL, 'H');
52 INSERT INTO t1 VALUES (NULL, 'I');
53 SELECT count(*) FROM t1;
56 do_test tkt-cbd05-1.2 {
59 PRAGMA writable_schema = 1;
61 SELECT tbl,idx,neq,nlt,ndlt,test_extract(sample,0) AS sample
63 PRAGMA writable_schema = 0;
66 do_test tkt-cbd05-1.3 {
68 SELECT tbl,idx,string_agg(s(sample),' ')
73 } {t1 t1_x { A B C D E F G H I}}
75 do_test tkt-cbd05-2.1 {
78 CREATE TABLE t1(a INTEGER PRIMARY KEY, b BLOB UNIQUE NOT NULL);
79 CREATE INDEX t1_x ON t1(b);
80 INSERT INTO t1 VALUES(NULL, X'');
81 INSERT INTO t1 VALUES(NULL, X'41');
82 INSERT INTO t1 VALUES(NULL, X'42');
83 INSERT INTO t1 VALUES(NULL, X'43');
84 INSERT INTO t1 VALUES(NULL, X'44');
85 INSERT INTO t1 VALUES(NULL, X'45');
86 INSERT INTO t1 VALUES(NULL, X'46');
87 INSERT INTO t1 VALUES(NULL, X'47');
88 INSERT INTO t1 VALUES(NULL, X'48');
89 INSERT INTO t1 VALUES(NULL, X'49');
90 SELECT count(*) FROM t1;
93 do_test tkt-cbd05-2.2 {
98 do_test tkt-cbd05-2.3 {
100 SELECT tbl,idx,group_concat(s(sample),' ')
105 } {t1 t1_x { A B C D E F G H I}}