Hi!
>>>>> "Peter" == Peter Zaitsev <pz@stripped> writes:
Peter> Hello Michael,
Peter> Wednesday, January 05, 2000, 2:44:59 AM, you wrote:
MW> Does it work with a normal 'a' ?
MW> Does it work with upper case / lower case characters.
Peter> I checked - the both small and big russian letters does not work there
Peter> both small and big english letters do work.
MW> If you want a quick fix, please try to always find out as much as
MW> possible about any bug and if possible include also a full working
MW> example.
Peter> OK. I just didn't know if you have version with win1251 charset.
Peter> I'v attached table and here is my investigations:
Peter> select * from test where test1="óÁÛÁ" - works fine.
Peter> select * from test where test2="óÁÛÁ" - works fine
Peter> select * from test where test1 like "ó%" - works fine
Peter> select * from test where test2 like "ó%" - works fine
Peter> select * from test where test1 like "%ó%" - wrong result (EMPTY SET)
Peter> select * from test where test2 like "%Á" - wrong result (EMPTY SET)
Peter> So the query returns wrong result for both VARCHAR and CHAR types then
Peter> using LIKE "%.....".
Peter> Here is the table create syntax.
Peter> CREATE TABLE test (
Peter> TEST1 varchar(80) DEFAULT '' NOT NULL,
Peter> TEST2 varchar(80) DEFAULT '' NOT NULL
Peter> );
Peter> #
Peter> # Dumping data for table 'test'
Peter> #
Peter> INSERT INTO test VALUES
> ('óÁÛÁ','óÁÛÁ');
Peter> Hope to get a fix soon.
Fix (only affects MySQL 3.23.x and 8 bit characters) :
((/my/monty/sql)) diff -c /tmp/sql_string.cc .
*** /tmp/sql_string.cc Thu Jan 6 19:11:10 2000
--- ./sql_string.cc Thu Jan 6 18:18:36 2000
***************
*** 482,490 ****
*/
#ifdef LIKE_CMP_TOUPPER
! #define likeconv(A) (char) toupper(A)
#else
! #define likeconv(A) (char) my_sort_order[(uchar) (A)]
#endif
static int wild_case_compare(const char *str,const char *str_end,
--- 482,490 ----
*/
#ifdef LIKE_CMP_TOUPPER
! #define likeconv(A) (uchar) toupper(A)
#else
! #define likeconv(A) (uchar) my_sort_order[(uchar) (A)]
#endif
static int wild_case_compare(const char *str,const char *str_end,
Regards,
Monty