Update test file walprotocol.test to account for the changes in the wal
[sqlite.git] / test / tkt2391.test
blobd192b85bd7c65dcee40ab7b4401d7fa8583b82ca
2 # 2007 May 28
4 # The author disclaims copyright to this source code.  In place of
5 # a legal notice, here is a blessing:
7 #    May you do good and not evil.
8 #    May you find forgiveness for yourself and forgive others.
9 #    May you share freely, never taking more than you give.
11 #***********************************************************************
12 # $Id: tkt2391.test,v 1.1 2007/05/29 12:11:30 danielk1977 Exp $
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
17 do_test tkt2391.1 {
18   execsql {
19     CREATE TABLE folders(folderid, parentid, foldername COLLATE binary);
20     INSERT INTO folders VALUES(1, 3, 'FolderA');
21     INSERT INTO folders VALUES(1, 3, 'folderB');
22     INSERT INTO folders VALUES(4, 0, 'FolderC');
23   }
24 } {}
26 do_test tkt2391.2 {
27   execsql {
28     SELECT count(*) FROM folders WHERE foldername < 'FolderC';
29   }
30 } {1}
32 do_test tkt2391.3 {
33   execsql {
34     SELECT count(*) FROM folders WHERE foldername < 'FolderC' COLLATE nocase;
35   }
36 } {2}
38 # This demonstrates the bug. Creating the index causes SQLite to ignore
39 # the "COLLATE nocase" clause and use the default collation sequence 
40 # for column "foldername" instead (happens to be BINARY in this case).
42 do_test tkt2391.4 {
43   execsql {
44     CREATE INDEX f_i ON folders(foldername);
45     SELECT count(*) FROM folders WHERE foldername < 'FolderC' COLLATE nocase;
46   }
47 } {2}
49 finish_test