Bug #64211 | 'CREATE TABLE ... LIKE ...' fails to keep case | ||
---|---|---|---|
Submitted: | 2 Feb 2012 16:26 | Modified: | 9 Apr 2012 16:08 |
Reporter: | Josh Trow | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
Version: | 5.5.18, 5.5.20 | OS: | Any (7 Pro x64, Mac OS X) |
Assigned to: | CPU Architecture: | Any | |
Tags: | case, create, like |
[2 Feb 2012 16:26]
Josh Trow
[2 Feb 2012 16:49]
Peter Laursen
Old bug! Same with MySQL 5.0 and 5.1 with lower_case_table_names = 2. Annoying! Peter (not a MySQL person)
[2 Feb 2012 18:11]
Valeriy Kravchuk
Verified with 5.5.20 on Mac OS X also: macbook-pro:5.5 openxs$ bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 5.5.20-debug Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create table `TestTable1` (c1 int); Query OK, 0 rows affected (1.19 sec) mysql> show tables like 'test%'; +------------------------+ | Tables_in_test (test%) | +------------------------+ | TestTable1 | | test | +------------------------+ 2 rows in set (0.02 sec) mysql> create table `TestTable2` like `TestTable1`; Query OK, 0 rows affected (0.25 sec) mysql> show tables like 'test%'; +------------------------+ | Tables_in_test (test%) | +------------------------+ | TestTable1 | | test | | testtable2 | +------------------------+ 3 rows in set (0.03 sec) mysql> show variables like 'lower%'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | lower_case_file_system | ON | | lower_case_table_names | 2 | +------------------------+-------+ 2 rows in set (0.07 sec) Does not look consistent or documented.
[9 Apr 2012 16:08]
Paul DuBois
Noted in 5.6.6 changelog. With lower_case_table_names=2 on systems with case-insensitive file systems such as Windows or Mac OS X, CREATE TABLE ... LIKE did not preserve lettercase of the destination table name as given in the statement.