Hello.


Really, seems a bit weird for me. I suggest you to check your

'character_set_xxx' variables to be sure that there're no

unnecessary translations from one encoding to another. If you're

able to make a small repeatable test case, install on your Debian

server second instance of MySQL (use official binaries) and check out

if the problem remains with a new copy.





[EMAIL PROTECTED] wrote:

> Recently I ran into a problem with 'LIKE' in mysql on Debian Sarge:

> 

> mysql> select VERSION();

> +---------------------------+

> | VERSION()                 |

> +---------------------------+

> | 4.1.11-Debian_4sarge2-log |

> +---------------------------+

> 1 row in set (0.00 sec)

> 

> with the following table:

> 

> CREATE TABLE `user` (

>   `id` int(10) unsigned NOT NULL auto_increment,

>   `username` varchar(64) collate latin2_hungarian_ci default NULL,

>   ...

> ) ENGINE=MyISAM DEFAULT CHARSET=latin2 COLLATE=latin2_hungarian_ci

> 

> I get the following outputs:

> 

> mysql> select count(*) from user where username like 'o%';

> +----------+

> | count(*) |

> +----------+

> |        0 |

> +----------+

> 1 row in set (0.00 sec)

> 

> mysql> select count(*) from user where username like 'or%';

> +----------+

> | count(*) |

> +----------+

> |        0 |

> +----------+

> 1 row in set (0.00 sec)

> 

> mysql> select count(*) from user where username like 'ors%';

> +----------+

> | count(*) |

> +----------+

> |       89 |

> +----------+

> 1 row in set (0.00 sec)

> 

> So the number of usernames which match "like 'o%'" is zero, while the

> number of matching lines for "like 'ors%'" is 89.

> 

> Moreover, the sum of the results of these two queries

> 

> select count(*) from user where username like 'a%';

> select count(*) from user where username not like 'a%' or username is null;

> 

> is not the same for all letters of the alphabet:

> 

> letter like not-like sum

> 

> n       2304 59317 61621

> o          0 60797 60797

> p       3048 58573 61621

> 

> Any ideas?

> 

> Zoltan

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to