mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
In MySQL when the mapping for space is changed to something other than 0x20 by defining a different collation, then space is not ignored when comparing two strings. This was happening because the function that performs the comparison of two strings while ignoring ending spaces, was comparing the collation value of a space with the ascii value of the ' ' character. This should be changed to do comparison between the collated values.
This commit is contained in:
@ -185,8 +185,8 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length,
|
||||
}
|
||||
for (end= a + a_length-length; a < end ; a++)
|
||||
{
|
||||
if (map[*a] != ' ')
|
||||
return (map[*a] < ' ') ? -swap : swap;
|
||||
if (map[*a] != map[' '])
|
||||
return (map[*a] < map[' ']) ? -swap : swap;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user