List:Commits« Previous MessageNext Message »
From:eugene Date:July 8 2007 9:23pm
Subject:bk commit into 5.0 tree (evgen:1.2521) BUG#29461
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-07-09 01:23:33+04:00, evgen@stripped +3 -0
  Bug#29461: Sort order of the collation wasn't used when comparing characters
  with the space character.
  
  When the my_strnncollsp_simple function compares two strings and one is a prefix
  of another then this function compares characters in the rest of longer key
  with the space character to find whether the longer key is greater or less.
  But the sort order of the collation isn't used in this comparison. This may
  lead to a wrong comparison result, wrongly created index or wrong order of the
  result set of a query with the ORDER BY clause.
  
  Now the my_strnncollsp_simple function uses collation sort order to compare
  the characters in the rest of longer key with the space character.

  mysql-test/r/ctype_collate.result@stripped, 2007-07-09 01:21:22+04:00, evgen@stripped +8 -0
    Added a test case for the bug#29461: Sort order of the collation wasn't used when
    comparing characters with the space character.

  mysql-test/t/ctype_collate.test@stripped, 2007-07-09 01:20:24+04:00, evgen@stripped +11 -0
    Added a test case for the bug#29461: Sort order of the collation wasn't used when
    comparing characters with the space character.

  strings/ctype-simple.c@stripped, 2007-07-09 01:21:39+04:00, evgen@stripped +1 -1
    Bug#29461: Sort order of the collation wasn't used when comparing characters
    with the space character.Now the my_strnncollsp_simple function uses collation sort order to compare
    the characters in the rest of longer key with the space character.

diff -Nrup a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
--- a/mysql-test/r/ctype_collate.result	2007-06-29 22:11:00 +04:00
+++ b/mysql-test/r/ctype_collate.result	2007-07-09 01:21:22 +04:00
@@ -603,3 +603,11 @@ check table t1 extended;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 drop table t1;
+create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
+insert into t1 set a=0x4c20;
+insert into t1 set a=0x6c;
+insert into t1 set a=0x4c98;
+check table t1 extended;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+drop table t1;
diff -Nrup a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
--- a/mysql-test/t/ctype_collate.test	2007-06-29 22:10:59 +04:00
+++ b/mysql-test/t/ctype_collate.test	2007-07-09 01:20:24 +04:00
@@ -218,3 +218,14 @@ insert into t1 set f1=0x3F3F1E563F;
 insert into t1 set f1=0x3F3F;
 check table t1 extended;
 drop table t1;
+
+#
+# Bug#29461: Sort order of the collation wasn't used when comparing characters
+#            with the space character.
+#
+create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
+insert into t1 set a=0x4c20;
+insert into t1 set a=0x6c;
+insert into t1 set a=0x4c98;
+check table t1 extended;
+drop table t1;
diff -Nrup a/strings/ctype-simple.c b/strings/ctype-simple.c
--- a/strings/ctype-simple.c	2007-06-29 22:12:44 +04:00
+++ b/strings/ctype-simple.c	2007-07-09 01:21:39 +04:00
@@ -179,7 +179,7 @@ int my_strnncollsp_simple(CHARSET_INFO *
     }
     for (end= a + a_length-length; a < end ; a++)
     {
-      if (*a != ' ')
+      if (map[*a] != ' ')
 	return (map[*a] < ' ') ? -swap : swap;
     }
   }
Thread
bk commit into 5.0 tree (evgen:1.2521) BUG#29461eugene8 Jul