Bug #7887 lower_case_table_names=2 on case sensitive filesystem
Submitted: 13 Jan 2005 22:43 Modified: 25 Jan 2005 4:52
Reporter: Hartmut Holzgraefe
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:4.1.8 OS:Linux (linux)
Assigned to: Jim Winstead Target Version:

[13 Jan 2005 22: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 13:13] Sergei Golubchik
another possible solution is nor to convert names to lowercase for open or directory
search.
[19 Jan 2005 21: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 4:27] Jim Winstead
Pushed to 4.1.
[25 Jan 2005 4:52] Paul DuBois
Mentioned in 4.1.10 change notes.