summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorV Narayanan <v.narayanan@sun.com>2009-10-12 13:13:15 +0530
committerV Narayanan <v.narayanan@sun.com>2009-10-12 13:13:15 +0530
commit3b02f76aaf17d423f70cb817a601ff61bdbea024 (patch)
treefcc774647b659c9e249e99fa5c0dc29ee60a65ee /strings
parentff4856723e4a34e2bd6e848de113a5761d50a860 (diff)
downloadmariadb-git-3b02f76aaf17d423f70cb817a601ff61bdbea024.tar.gz
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.
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-simple.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 7de00025eda..4f3aaa6f668 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -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;