summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-12-08 13:19:19 +0400
committerAlexander Barkov <bar@mariadb.org>2017-12-08 13:19:19 +0400
commit0e5eef886ac281599da2caa24e0a560b4f889c7d (patch)
tree8cab5bd78a286bda2830e9c8f9ce8458dbf074d7 /strings
parentdfafe15abbd552ed487b2b0f7188db9303b1fa1f (diff)
downloadmariadb-git-0e5eef886ac281599da2caa24e0a560b4f889c7d.tar.gz
MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-mb.c10
-rw-r--r--strings/ctype-simple.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 9e476c23202..bfd533e6f98 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -799,9 +799,9 @@ fill_max_and_min:
'a\0\0... is the smallest possible string when we have space expand
a\ff\ff... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
+ *min_length= (cs->state & (MY_CS_BINSORT | MY_CS_NOPAD)) ?
+ (size_t) (min_str - min_org) :
+ res_length;
/* Create min key */
do
{
@@ -1002,9 +1002,9 @@ my_like_range_generic(CHARSET_INFO *cs,
a\min\min... is the smallest possible string
a\max\max... is the biggest possible string
*/
- *min_length= ((cs->state & MY_CS_BINSORT) ?
+ *min_length= (cs->state & (MY_CS_BINSORT | MY_CS_NOPAD)) ?
(size_t) (min_str - min_org) :
- res_length);
+ res_length;
*max_length= res_length;
goto pad_min_max;
}
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index cf73f117f0f..fc5218caba1 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1059,9 +1059,9 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
if (*ptr == w_many) /* '%' in SQL */
{
/* Calculate length of keys */
- *min_length= ((cs->state & MY_CS_BINSORT) ?
+ *min_length= (cs->state & (MY_CS_BINSORT | MY_CS_NOPAD)) ?
(size_t) (min_str - min_org) :
- res_length);
+ res_length;
*max_length= res_length;
do
{