Bug #33898 | mysqldump from Windows database has lowercase table names | ||
---|---|---|---|
Submitted: | 17 Jan 2008 15:24 | Modified: | 23 Jan 2008 14:08 |
Reporter: | Trey Howard | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S2 (Serious) |
Version: | 5.0.45 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[17 Jan 2008 15:24]
Trey Howard
[17 Jan 2008 16:05]
Patrick Crews
Couldn't this be overcome using lower_case_table_names=2? http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html I tested this out on 5.0.45 on Windows and it preserved the case of statements used in creating my tables on running mysqldump. While it's not elegant and requires additional startup parameters, there is a way to avoid conversion to lowercase.
[17 Jan 2008 16:16]
Trey Howard
Technically speaking, yes. Beyond not being elegant, this is not satisfactory for our purposes. We often have to deal with customer databases, and we have no control over the configuration parameters of customer databases. Can you be more specific on why conversion to lowercase cannot be avoided? Do you mean that this cannot be avoided for MySQL5? Is it a planned improvement for a future release (eg: MySQL6)? Surely there is a way to fix this, even if the fix is non-trivial.
[17 Jan 2008 16:40]
Trey Howard
I think I mis-spoke before. You had suggested lctn=2, but I thought you mean lower_case_table_name=1. I don't believe lctn=2 will solve the problem of dumping from the Windows box and importing into a Linux box. Isn't setting 2 only available for the Windows box (as per the documentation)? Furthermore, I'm confused by the documentation because I am running a Windows server with lctn=0, but this does not seem to be enforced. The FKs in my database display via SHOW CREATE TABLE with the lowercase table name, but work just fine. The docs for lctn=0 indicate that the comparison is made case-sensitively, which should prevent my database from behaving as observed, correct? What differences should I expect to see between lctn=0 and =2?
[18 Jan 2008 21:49]
Patrick Crews
Using lctn=2 still seems to convert to lowercase while running on Windows, but will preserve the original case on mysqldump -- Windows-based server behaves as lctn=1 while on Windows. When you use mysqldump when lctn=2, the output will exhibit the original case of your SQL statements -- CREATE TABLE tEsTcAsE (Column_1 int); Will be the mysqldump output even if the windows machine accepts testcase, TESTCASE, etc. I can't speak for any planned changes to this behavior, I was only trying to suggest something that would help.
[23 Jan 2008 14:08]
Sveta Smirnova
Thank you for the report. But this is not a bug. Read about lower_case_table_names and Windows at http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html
[29 Jul 2012 22:35]
Thomas Bachmann
Same behaviour on OS X as well ;(