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)