[MySQL] INFORMATION_SCHEMA から動的にテーブルを作るテストケースが動かなくて、はまってた件

lower_case_table_names=2 の環境のみ (= Win32, OSX) の話なんですが。大文字を含む名前をもつテーブルの INFORMATION_SCHEMA を読んじゃうと、以後 mysqld を再起動するまで同名の CREATE TABLE できなくなるという...

バグとしては5月に報告されていたらしく (MySQL Bugs: #44738: fill_schema_table_from_frm opens tables without lowercasing table name; ログ見てると対応素早い \^o^/ )、mysql 6.0 のツリーでは直ってるらしい。早く 5.1 にも下りてこないかなぁ。

mysql> create table FOO (id int unsigned not null);
Query OK, 0 rows affected (0.23 sec)

mysql> select column_name from information_schema.columns where table_name='FOO';
+-------------+
| column_name |
+-------------+
| id          | 
+-------------+
1 row in set (0.03 sec)

mysql> drop table FOO;
Query OK, 0 rows affected (0.01 sec)

mysql> create table FOO (id int unsigned not null);
ERROR 1050 (42S01): Table 'foo' already exists