4
在我的Windows機器上,當我從MySQL中使用下面的查詢選擇表名時,我得到表名稱區分大小寫。與Windows中的MySql區分大小寫的表名的奇怪行爲
mysql> select table_schema, table_name
from information_schema.tables where table_schema='test';
+--------------+------------+
| table_schema | table_name |
+--------------+------------+
| test | TableOne |
| test | TableTwo |
+--------------+------------+
2 rows in set (0.00 sec)
但是,當我通過表名選擇我得到不同的結果。
mysql> select table_schema, table_name from information_schema.tables
where table_schema='test' and table_name = 'TableOne';
+--------------+------------+
| table_schema | table_name |
+--------------+------------+
| test | tableone |
+--------------+------------+
1 row in set (0.00 sec)
這是什麼讓它更奇怪呢。
mysql> select table_schema, table_name from information_schema.tables
where table_schema='test' and table_name like 'TableOne';
+--------------+------------+
| table_schema | table_name |
+--------------+------------+
| test | TableOne |
+--------------+------------+
1 row in set (0.00 sec)