Commit 03cba628 authored by unknown's avatar unknown
Browse files

Bug#6787 LIKE not working properly with _ and utf8 data

parent 232bbfda
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t';
select 'a  a' > 'a', 'a  \t' < 'a';
'a  a' > 'a'	'a  \t' < 'a'
1	1
select 'c' like '\_' as want0;
want0
0
CREATE TABLE t (
c char(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+3 −0
Original line number Diff line number Diff line
@@ -814,3 +814,6 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
drop table t1;
select 'c' like '\_' as want0;
want0
0
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,11 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t';

select 'a  a' > 'a', 'a  \t' < 'a';

#
# Bug #6787 LIKE not working properly with _ and utf8 data
#
select 'c' like '\_' as want0; 

#
# Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters
#
+6 −0
Original line number Diff line number Diff line
@@ -660,3 +660,9 @@ create table t2 select concat(a,_utf8'') as a, concat(b,_utf8'')as b from t1;
show create table t2;
drop table t2;
drop table t1;

#
# Bug #6787 LIKE not working properly with _ and utf8 data
#
select 'c' like '\_' as want0; 
+3 −1
Original line number Diff line number Diff line
@@ -7288,6 +7288,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
  {
    while (1)
    {
      my_bool escaped= 0;
      if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
		       (const uchar*)wildend)) <= 0)
	return 1;
@@ -7305,6 +7306,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
			(const uchar*)wildend)) <= 0)
          return 1;
        wildstr+= scan;
        escaped= 1;
      }
      
      if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
@@ -7312,7 +7314,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
        return 1;
      str+= scan;
      
      if (w_wc == (my_wc_t)w_one)
      if (!escaped && w_wc == (my_wc_t)w_one)
      {
        result= 1;				/* Found an anchor char */
      }
Loading