Bug #7887 lower_case_table_names=2 on case sensitive filesystem
Submitted: 13 Jan 2005 21:43 Modified: 25 Jan 2005 3:52
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.8 OS:Linux (linux)
Assigned to: Jim Winstead CPU Architecture:Any

[13 Jan 2005 21:43] Hartmut Holzgraefe
Description:
When setting lower_case_table_names to 2 on a case sensitive filesystem
creating a table with uppercase letters succeeds but the table is unusable.

The table files are with the uppercase letters preserved in their filenames
but when trying to access the table the lowercased version of the name is
used.

How to repeat:
in my.cnf set:   lower_case_table_names=2

then try:

CREATE TABLE foobar(I INT);
DESCRIBE foobar;
... OK ...

CREATE TABLE FOOBAR2(I INT);
DESCRIBE FOOBAR2;
ERROR 1146 (42S02): Table 'test.foobar2' doesn't exist

Suggested fix:
make sure filenames are lowercased even when lower_case_table_names is set to 2
or do a sanity check on the datadir file system and bail out if it is tried on a case sensitive
file system
[14 Jan 2005 12:13] Sergei Golubchik
another possible solution is nor to convert names to lowercase for open or directory search.
[19 Jan 2005 20:33] Jim Winstead
The patch just outputs a warning when lower_case_table_names=2 and the datadir is on a case-sensitive filesystem, like we do for lower_case_table_names=0 and case-insensitive filesystems.
[25 Jan 2005 3:27] Jim Winstead
Pushed to 4.1.
[25 Jan 2005 3:52] Paul DuBois
Mentioned in 4.1.10 change notes.