summaryrefslogtreecommitdiff
path: root/mysys/my_compare.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-03-31 11:04:48 +0400
committerAlexander Barkov <bar@mariadb.org>2016-03-31 11:04:48 +0400
commit1d73005bf357a607423f858482c52ecb4712607d (patch)
tree974a3bbb7f8ee2ef7c0b15aa16aed03baa18926a /mysys/my_compare.c
parent282497dd6d1049b4fb963641504c2733752845a7 (diff)
downloadmariadb-git-1d73005bf357a607423f858482c52ecb4712607d.tar.gz
MDEV-8360 Clean-up CHARSET_INFO: strnncollsp: diff_if_only_endspace_difference
- Removing the "diff_if_only_endspace_difference" argument from MY_COLLATION_HANDLER::strnncollsp(), my_strnncollsp_simple(), as well as in the function template MY_FUNCTION_NAME(strnncollsp) in strcoll.ic - Removing the "diff_if_only_space_different" from ha_compare_text(), hp_rec_key_cmp(). - Adding a new function my_strnncollsp_padspace_bin() and reusing it instead of duplicate code pieces in my_strnncollsp_8bit_bin(), my_strnncollsp_latin1_de(), my_strnncollsp_tis620(), my_strnncollsp_utf8_cs(). - Adding more tests for better coverage of the trailing space handling. - Removing the unused definition of HA_END_SPACE_ARE_EQUAL
Diffstat (limited to 'mysys/my_compare.c')
-rw-r--r--mysys/my_compare.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/mysys/my_compare.c b/mysys/my_compare.c
index 6de7ff774c0..3c21d74a8a4 100644
--- a/mysys/my_compare.c
+++ b/mysys/my_compare.c
@@ -21,12 +21,11 @@
#include <my_sys.h>
int ha_compare_text(CHARSET_INFO *charset_info, const uchar *a, uint a_length,
- const uchar *b, uint b_length, my_bool part_key,
- my_bool skip_end_space)
+ const uchar *b, uint b_length, my_bool part_key)
{
if (!part_key)
return charset_info->coll->strnncollsp(charset_info, a, a_length,
- b, b_length, (my_bool)!skip_end_space);
+ b, b_length);
return charset_info->coll->strnncoll(charset_info, a, a_length,
b, b_length, part_key);
}
@@ -186,8 +185,7 @@ int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
if (piks &&
(flag=ha_compare_text(keyseg->charset,a,a_length,b,b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),
- (my_bool)!(nextflag & SEARCH_PREFIX))))
+ next_key_length <= 0))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=a_length;
b+=b_length;
@@ -199,8 +197,7 @@ int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
if (piks &&
(flag= ha_compare_text(keyseg->charset, a, a_length, b, b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),
- (my_bool)!(nextflag & SEARCH_PREFIX))))
+ next_key_length <= 0))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a=end;
b+=length;
@@ -247,12 +244,7 @@ int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
if (piks &&
(flag= ha_compare_text(keyseg->charset,a,a_length,b,b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),
- (my_bool) ((nextflag & (SEARCH_FIND |
- SEARCH_UPDATE)) ==
- SEARCH_FIND &&
- ! (keyseg->flag &
- HA_END_SPACE_ARE_EQUAL)))))
+ next_key_length <= 0))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+= a_length;
b+= b_length;