List:General Discussion« Previous MessageNext Message »
From:Khimenko Victor Date:September 17 1999 4:57pm
Subject:Re: MySQL 3.23.3, russian characters and LIKE
View as plain text  
In <14306.20360.547088.513740@stripped> Michael Widenius
(monty@stripped) wrote:
>>>>>> "Khimenko" == Khimenko Victor <khim@stripped> writes:

MW> Khimenko> LIKE does not work with russian characters in MySQL 3.23.3 :-/ Here is
> the fix.
MW> Khimenko> Problem is in comparision `likeconv(*str) != cmp' on line 583...

MW> Khimenko> I'm not sure if it's correct fix but at least I can use LIKE now :-)

MW> Khimenko> --- sql/sql_string.cc
MW> Khimenko> +++ sql/sql_string.cc
MW> Khimenko> @@ -518,7 +518,7 @@
MW> Khimenko>        if (str == str_end)
MW> Khimenko>   return result;

MW> Khimenko> -      char cmp;
MW> Khimenko> +      uchar cmp;
MW> Khimenko>        if ((cmp= *wildstr) == escape && wildstr+1 != wildend)
MW> Khimenko>   cmp= *++wildstr;
MW> Khimenko>  #ifdef USE_BIG5CODE

MW> Hi!

MW> Could you try this instead:

MW> Change the likeconv macros to:

MW> #ifdef LIKE_CMP_TOUPPER
MW> #define likeconv(A) (char) toupper(A)
MW> #else
MW> #define likeconv(A) (char) my_sort_order[(uchar) (A)]
MW> #endif

Of course it works as well (just tested). BTW do you know why there are was
no complains from gcc while compiling sql_string.cc about this collision ?
Are there way to catch such problems with char/uchar automagically -- it's
really hard to catch all of them without some automation :-/



Thread
MySQL 3.23.3, russian characters and LIKEKhimenko Victor16 Sep
  • MySQL 3.23.3, russian characters and LIKEMichael Widenius17 Sep
    • Re: MySQL 3.23.3, russian characters and LIKEKhimenko Victor17 Sep