SQLite4
Check-in [fe9ccd646d]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a bug in the nocase collation xMkKey function.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fe9ccd646dba4197c45fe7a9fa3c1af80183015e
User & Date: dan 2012-04-23 14:54:20
Context
2012-04-23
15:49
Remove the OS/2 interface logic. check-in: 9a64e0bc7e user: drh tags: trunk
14:54
Fix a bug in the nocase collation xMkKey function. check-in: fe9ccd646d user: dan tags: trunk
14:26
Remove the VDBE merge sorter. check-in: 1073bb477e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
}

static int collNocaseMkKey(
  void *NotUsed,
  int nIn, const void *pKey1,
  int nOut, void *pKey2
){
  if( nOut<nIn ){
    int i;
    u8 *aIn = (u8 *)pKey1;
    u8 *aOut = (u8 *)pKey2;
    for(i=0; i<nIn; i++){
      aOut[i] = sqlite4UpperToLower[aIn[i]];
    }
  }







|







605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
}

static int collNocaseMkKey(
  void *NotUsed,
  int nIn, const void *pKey1,
  int nOut, void *pKey2
){
  if( nOut>=nIn ){
    int i;
    u8 *aIn = (u8 *)pKey1;
    u8 *aOut = (u8 *)pKey2;
    for(i=0; i<nIn; i++){
      aOut[i] = sqlite4UpperToLower[aIn[i]];
    }
  }

Changes to test/permutations.test.

131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
lappend ::testsuitelist xxx

test_suite "src4" -prefix "" -description {
} -files {
  simple.test fkey1.test conflict.test trigger2.test select1.test
  where.test select3.test select5.test select7.test select8.test
  selectB.test selectC.test
}

test_suite "veryquick" -prefix "" -description {
  "Very" quick test suite. Runs in less than 5 minutes on a workstation. 
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [







|







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
lappend ::testsuitelist xxx

test_suite "src4" -prefix "" -description {
} -files {
  simple.test fkey1.test conflict.test trigger2.test select1.test
  where.test select3.test select5.test select7.test select8.test
  selectA.test selectB.test selectC.test
}

test_suite "veryquick" -prefix "" -description {
  "Very" quick test suite. Runs in less than 5 minutes on a workstation. 
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [

Changes to test/simple.test.

895
896
897
898
899
900
901
902
903
904
905
906

















907
908
909
#-------------------------------------------------------------------------
reset_db

do_execsql_test 46.1 {
  CREATE TABLE t1(x, y COLLATE nocase);
  CREATE UNIQUE INDEX i1 ON t1(y);
}

do_catchsql_test 46.2 {
  INSERT INTO t1 VALUES(1, 'ABC');
  INSERT INTO t1 VALUES(2, 'abc');
} {1 {column y is not unique}}


















finish_test








<




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



895
896
897
898
899
900
901

902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
#-------------------------------------------------------------------------
reset_db

do_execsql_test 46.1 {
  CREATE TABLE t1(x, y COLLATE nocase);
  CREATE UNIQUE INDEX i1 ON t1(y);
}

do_catchsql_test 46.2 {
  INSERT INTO t1 VALUES(1, 'ABC');
  INSERT INTO t1 VALUES(2, 'abc');
} {1 {column y is not unique}}

#-------------------------------------------------------------------------
reset_db

do_execsql_test 47.1 {
  CREATE TABLE t1(x);
  INSERT INTO t1 VALUES('D');
  INSERT INTO t1 VALUES('a');
  INSERT INTO t1 VALUES('c');
  INSERT INTO t1 VALUES('B');
}
do_execsql_test 47.2 {
  SELECT x FROM t1 ORDER BY x;
} {B D a c}
do_execsql_test 47.3 {
  SELECT x FROM t1 ORDER BY x COLLATE nocase;
} {a B c D}

finish_test