Http://topic.csdn.net/u/20081204/13/841fbb19-7ca0-439d-b353-e6578ac98365.html
This can be attributed to a typical character set problem. When the character sets are set to the same, no errors will occur.
See:
Mysql> show variables like 'Char % ';
+ -------------------------- + ------------------------------------------- +
| Variable_name | value |
+ -------------------------- + ------------------------------------------- +
| Character_set_client | Latin1 |
| Character_set_connection | Latin1 |
| Character_set_database | GBK |
| Character_set_results | Latin1 |
| Character_set_server | GBK |
| Character_set_system | utf8 |
| Character_sets_dir | D :\ mysql-5.0.9-beta-win32 \ share \ charsets/|
+ -------------------------- + ------------------------------------------- +
7 rows in SET (0.01 Sec)
Mysql> set names 'gbk ';
Query OK, 0 rows affected (0.00 Sec)
Mysql> show variables like 'Char % ';
+ -------------------------- + ------------------------------------------- +
| Variable_name | value |
+ -------------------------- + ------------------------------------------- +
| Character_set_client | GBK |
| Character_set_connection | GBK |
| Character_set_database | GBK |
| Character_set_results | GBK |
| Character_set_server | GBK |
| Character_set_system | utf8 |
| Character_sets_dir | D :\ mysql-5.0.9-beta-win32 \ share \ charsets/|
+ -------------------------- + ------------------------------------------- +
7 rows in SET (0.00 Sec)
Mysql> select * from A1;
+ ------ +
| Word |
+ ------ +
| Rat |
| Try |
+ ------ +
2 rows in SET (0.00 Sec)
Mysql> Delete from A1;
Query OK, 2 rows affected (0.02 Sec)
Mysql> insert into A1 values ('rat ');
Query OK, 1 row affected (0.06 Sec)
Mysql> insert into A1 values ('test ');
Query OK, 1 row affected (0.08 Sec)
Mysql> select * from A1 where WORD = 'rat ';
+ ------ +
| Word |
+ ------ +
| Rat |
+ ------ +
1 row in SET (0.01 Sec)
This will not be a problem. If you are interested, try it.
Binary like seems to be another matching method.