mirror of
https://github.com/MariaDB/server.git
synced 2026-04-21 15:55:53 +02:00
Bug#29261: Sort order of the collation wasn't used when comparing trailing
spaces. 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.
This commit is contained in:
parent
f8b7669ee9
commit
fc601d775f
3 changed files with 20 additions and 1 deletions
|
|
@ -180,7 +180,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 != ' ')
|
||||
return (*a < ' ') ? -swap : swap;
|
||||
return (map[*a] < ' ') ? -swap : swap;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue