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
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');
28 SELECT count(*) FROM folders WHERE foldername < 'FolderC';
34 SELECT count(*) FROM folders WHERE foldername < 'FolderC' COLLATE nocase;
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).
44 CREATE INDEX f_i ON folders(foldername);
45 SELECT count(*) FROM folders WHERE foldername < 'FolderC' COLLATE nocase;