Bug #68260 | setting lower_case_table_names variable to 1 prevents access to tables | ||
---|---|---|---|
Submitted: | 4 Feb 2013 9:27 | Modified: | 5 Feb 2013 7:14 |
Reporter: | Shahriyar Rzayev | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Options | Severity: | S3 (Non-critical) |
Version: | 5.5.29 | OS: | Linux (Centos 6.3) |
Assigned to: | CPU Architecture: | Any | |
Tags: | lower_case_table_names, system variable |
[4 Feb 2013 9:27]
Shahriyar Rzayev
[5 Feb 2013 6:34]
Erlend Dahl
Please refer to http://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html For lower_case_table_names=1, "MySQL converts all table names to lowercase on storage and lookup". This is consistent with what you see, "City" gets converted to "city" when doing the lookup. Hence you cannot access your old table. There is no reason why your "City" table should be renamed "city" automatically. Indeed, with lower_case_table_names=0, you could start off with two tables, one named "City" and the other named "city", and then it is not clear how renaming should work. The manual states: "If you plan to set the lower_case_table_names system variable to 1 on Unix, you must first convert your old database and table names to lowercase before stopping mysqld and restarting it with the new variable setting." So this is not a bug, in my opinion.
[5 Feb 2013 7:14]
Shahriyar Rzayev
As you say and as documentation says lower_case_table_names=0 MySQL store identifier name as you write in create statement. So if i create City with upper case it will store it as City. and when you want access City as city the error arise.(while lower_case_table_names=0 ) But with lower_case_table_names=1 City must be converted to city but as my report shows there is no conversion and even i cant access my tables. So if there is no conversion why i can not access my tables? simple logic :) i read the documentation. If i have 1000 tables and i want to set lower_case_table_names=1 i must manually change them to lowercase or dump and restore.. is it convenient? let it is not a bug. but it is still very dangerous in production setting this variable to 1 and not access tables. So there must be a hint or a caution section in documentation: "You can not access your previous data in Linux if you set lower_case_table_names to 1 without manually renaming or dumping your data. "