summaryrefslogtreecommitdiff
path: root/strings/strcoll.ic
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-09-06 12:50:02 +0400
committerAlexander Barkov <bar@mariadb.org>2016-09-06 12:50:02 +0400
commitee19806b8e6bb00fa1cd547fe3e75193859d300d (patch)
tree27568e9cc17e2717785af028c65deb912731bfb9 /strings/strcoll.ic
parente4f6fd5e1252f8c68f449fe820bae88c18bca8f5 (diff)
downloadmariadb-git-ee19806b8e6bb00fa1cd547fe3e75193859d300d.tar.gz
MDEV-9711 NO PAD collations
Based on the patch from Daniil Medvedev (a Google Summer of Code task)
Diffstat (limited to 'strings/strcoll.ic')
-rw-r--r--strings/strcoll.ic28
1 files changed, 27 insertions, 1 deletions
diff --git a/strings/strcoll.ic b/strings/strcoll.ic
index a9693b1f3c0..c647a5ef57e 100644
--- a/strings/strcoll.ic
+++ b/strings/strcoll.ic
@@ -202,8 +202,10 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs __attribute__((unused)),
}
+#ifdef DEFINE_STRNNCOLLSP_NOPAD
+
/**
- Compare two strings according to the collation, with PAD SPACE handling.
+ Compare two strings according to the collation, with NO PAD handling.
@param cs - the character set and collation
@param a - the left string
@@ -212,7 +214,24 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs __attribute__((unused)),
@param b_length - the length of the right string
@return - the comparison result
*/
+static int
+MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length)
+{
+ return MY_FUNCTION_NAME(strnncoll)(cs, a, a_length, b, b_length, FALSE);
+}
+#else
+/**
+ Compare two strings according to the collation, with PAD SPACE handling.
+ @param cs - the character set and collation
+ @param a - the left string
+ @param a_length - the length of the left string
+ @param b - the right string
+ @param b_length - the length of the right string
+ @return - the comparison result
+*/
static int
MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, size_t a_length,
@@ -257,6 +276,7 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)),
DBUG_ASSERT(0);
return 0;
}
+#endif
#ifdef DEFINE_STRNXFRM
@@ -292,7 +312,12 @@ MY_FUNCTION_NAME(strnxfrm)(CHARSET_INFO *cs,
else
*dst++= sort_order ? sort_order[*src++] : *src++;
}
+#ifdef DEFINE_STRNNCOLLSP_NOPAD
+ return my_strxfrm_pad_desc_and_reverse_nopad(cs, d0, dst, de,
+ nweights, flags, 0);
+#else
return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0);
+#endif
}
#endif /* DEFINE_STRNXFRM */
@@ -310,3 +335,4 @@ MY_FUNCTION_NAME(strnxfrm)(CHARSET_INFO *cs,
#undef WEIGHT_PAD_SPACE
#undef WEIGHT_MB2_FRM
#undef DEFINE_STRNXFRM
+#undef DEFINE_STRNNCOLLSP_NOPAD