diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-03-25 06:42:44 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2016-03-25 06:42:44 +0400 |
commit | 3be95ee061b8695922981c67480b80167fb3f492 (patch) | |
tree | e017d78b72c4e74d82e3184f02168f1557dea2b5 /strings | |
parent | 02839ef249c724cde7c4b1b8d6815f1792ec0895 (diff) | |
download | mariadb-git-3be95ee061b8695922981c67480b80167fb3f492.tar.gz |
Removing my_strnncoll_mb_bin() and my_strnncollsp_mb_bin(),
as they are not used any more.
We now use function templates from strcoll.ic instead.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-mb.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 9049596c7a4..3fa66cb0b2f 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -571,93 +571,6 @@ uint my_instr_mb(CHARSET_INFO *cs, } -/* BINARY collations handlers for MB charsets */ - -int -my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)), - const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool t_is_prefix) -{ - size_t len=MY_MIN(slen,tlen); - int cmp= memcmp(s,t,len); - return cmp ? cmp : (int) ((t_is_prefix ? len : slen) - tlen); -} - - -/* - Compare two strings. - - SYNOPSIS - my_strnncollsp_mb_bin() - cs Chararacter set - s String to compare - slen Length of 's' - t String to compare - tlen Length of 't' - diff_if_only_endspace_difference - Set to 1 if the strings should be regarded as different - if they only difference in end space - - NOTE - This function is used for character strings with binary collations. - The shorter string is extended with end space to be as long as the longer - one. - - RETURN - A negative number if s < t - A positive number if s > t - 0 if strings are equal -*/ - -int -my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), - const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference) -{ - const uchar *end; - size_t length; - int res; - -#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE - diff_if_only_endspace_difference= 0; -#endif - - end= a + (length= MY_MIN(a_length, b_length)); - while (a < end) - { - if (*a++ != *b++) - return ((int) a[-1] - (int) b[-1]); - } - res= 0; - if (a_length != b_length) - { - int swap= 1; - if (diff_if_only_endspace_difference) - res= 1; /* Assume 'a' is bigger */ - /* - Check the next not space character of the longer key. If it's < ' ', - then it's smaller than the other key. - */ - if (a_length < b_length) - { - /* put shorter key in s */ - a_length= b_length; - a= b; - swap= -1; /* swap sign of result */ - res= -res; - } - for (end= a + a_length-length; a < end ; a++) - { - if (*a != ' ') - return (*a < ' ') ? -swap : swap; - } - } - return res; -} - - /* Copy one non-ascii character. "dst" must have enough room for the character. |