diff options
author | unknown <evgen@moonbone.local> | 2007-07-09 01:23:33 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-07-09 01:23:33 +0400 |
commit | bfa027e72e99c2cd27df3cf3869289ddc9bff5a3 (patch) | |
tree | faf418fa6e9c8f84392d706700b9dc4cad20f266 /strings | |
parent | 8195a213c2fadfb185e755ce6dda2162df1a5529 (diff) | |
download | mariadb-git-bfa027e72e99c2cd27df3cf3869289ddc9bff5a3.tar.gz |
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/t/ctype_collate.test:
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/r/ctype_collate.result:
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:
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.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-simple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index fca5607e152..8b1b0d6790d 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -179,7 +179,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, } for (end= a + a_length-length; a < end ; a++) { - if (*a != ' ') + if (map[*a] != ' ') return (map[*a] < ' ') ? -swap : swap; } } |