Paolo Vernazza wrote:
I found a strange behaviour when ordering a table where a row is defined with COLLATE NOCASE and the data contains empty strings.

...

the result is

a|
a|a
b|a
b|
a|b
b|b

It is a feature or a bug?


A bug in NOCASE.

--- main.c      28 Aug 2004 16:19:01 -0000      1.255
+++ main.c      29 Aug 2004 20:06:48 -0000
@@ -407,7 +407,7 @@
   int nKey2, const void *pKey2
 ){
   int r = sqlite3StrNICmp(
-      (const char *)pKey1, (const char *)pKey2, (nKey1>nKey2)?nKey1:nKey2);
+      (const char *)pKey1, (const char *)pKey2, (nKey1<nKey2)?nKey1:nKey2);
   if( 0==r ){
     r = nKey1-nKey2;
   }



--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565



Reply via email to