Tiny Tweak: Tilde in Chinese
For those who haven’t memorized the names of every symbol: the tilde is the wavy line that appears occasionally over specific characters, particularly over N in Spanish. But it can appear alone. If you’re North American and you look at the top left corner of your keyboard, you’ll probably see it:
~
Anyway, we ran into this bug during a comprehensive re-test of all the Chinese character sets:
mysql> create table tbig5 (s1 char(5) character set big5);
Query OK, 0 rows affected (0.11 sec)mysql> insert into tbig5 values ('Y'),('~');
Query OK, 2 rows affected (0.08 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from tbig5 where s1 = 'Y';
+------+
| s1 |
+------+
| Y |
| ~ |
+------+
2 rows in set (0.04 sec)
This is Bug#25420 “Tilde = ‘Y’ in Chinese”. It has been around for years, ever since the contribution of the BIG5 Chinese character set. No Chinese user has every complained — frankly I doubt that the Chinese have found much use for ~s yet. Alexander Barkov had no difficulty fixing it. It’s a trivial bug and a trivial fix. Um. Except that we must think about consequences even for trivia.
Indexes in MySQL are usually in order. (Don’t say “duh”, please, they don’t have to be thus, and in fact Falcon indexes can be a tiny bit disordered with no danger.) So it’s just possible that somewhere a Chinese database contains the index keys in order:
~ Y Z
and that somebody, after the fix for Bug#25420 is in, will add a new tilde, making the index look like
~ Y Z ~
which is no longer in order.
Call us finicky, but we can’t just put the bug fix into a production release, or even a release candidate like MySQL 5.1. The plan is to turn the fix on for MySQL 6.0, and encourage checks when users upgrade, perhaps with a warning during the mysql_upgrade script.

Leave a Reply