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 #***********************************************************************
11 # Test cases for a crash bug.
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16 set testprefix collateB
18 do_execsql_test collateB-1.1 {
19 CREATE TABLE t1(a INTEGER PRIMARY KEY);
20 CREATE TABLE t2(b INTEGER PRIMARY KEY, x1 INT COLLATE NOCASE);
21 CREATE TABLE t3(x2 INT);
22 SELECT * FROM t3, t2, t1 WHERE x2=b AND x1=a AND a=1;
24 do_execsql_test collateB-1.2 {
25 INSERT INTO t1(a) VALUES(1),(2),(3);
26 INSERT INTO t2(b,x1) VALUES(11,1),(22,2),(33,3);
27 INSERT INTO t3(x2) VALUES(11),(22),(33);
28 SELECT *,'|' FROM t3, t2, t1 WHERE x2=b AND x1=a AND a=1;
30 do_execsql_test collateB-1.3 {
31 SELECT *,'|' FROM t3, t1, t2 WHERE x2=b AND x1=a AND a=1;
33 do_execsql_test collateB-1.4 {
34 SELECT *,'|' FROM t2, t3, t1 WHERE x2=b AND x1=a AND a=1;
36 do_execsql_test collateB-1.5 {
37 SELECT *,'|' FROM t2, t1, t3 WHERE x2=b AND x1=a AND a=1;
39 do_execsql_test collateB-1.6 {
40 SELECT *,'|' FROM t1, t2, t3 WHERE x2=b AND x1=a AND a=1;
42 do_execsql_test collateB-1.7 {
43 SELECT *,'|' FROM t1, t2, t3 WHERE x2=b AND x1=a AND a=1;
45 do_execsql_test collateB-1.12 {
46 SELECT *,'|' FROM t3, t2, t1 WHERE b=x2 AND a=x1 AND 1=a;
48 do_execsql_test collateB-1.13 {
49 SELECT *,'|' FROM t3, t1, t2 WHERE b=x2 AND a=x1 AND 1=a;
51 do_execsql_test collateB-1.14 {
52 SELECT *,'|' FROM t2, t3, t1 WHERE b=x2 AND a=x1 AND 1=a;
54 do_execsql_test collateB-1.15 {
55 SELECT *,'|' FROM t2, t1, t3 WHERE b=x2 AND a=x1 AND 1=a;
57 do_execsql_test collateB-1.16 {
58 SELECT *,'|' FROM t1, t2, t3 WHERE b=x2 AND a=x1 AND 1=a;
60 do_execsql_test collateB-1.17 {
61 SELECT *,'|' FROM t1, t2, t3 WHERE b=x2 AND a=x1 AND 1=a;
64 #-------------------------------------------------------------------------
65 # Test an assert() failure that was occuring if an index were created
66 # on a column explicitly declared "COLLATE binary".
69 CREATE TABLE t4(a COLLATE binary);
70 CREATE INDEX i4 ON t4(a);
71 INSERT INTO t4 VALUES('one'), ('two'), ('three');