Bug #3109 lower_case_table_names=2 isn't honored when creating index
Submitted: 8 Mar 2004 12:22 Modified: 23 Jun 2004 8:51
Reporter: Miguel Solorzano Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0 OS:Windows (Windows)
Assigned to: MySQL Verification Team CPU Architecture:Any

[8 Mar 2004 12:22] Miguel Solorzano
Description:
A table created with upper case letters is converted to lower
case letters when creating an index.

How to repeat:
1- Create one table with upper case letters:

mysql> create table SINISA (ID int, NAME char(20));

2- You can verified that effectively was created like typed.
 
08/03/2004  14:52    <DIR>          .
08/03/2004  14:52    <DIR>          ..
08/03/2004  14:52             8.574 SINISA.frm
08/03/2004  14:52                 0 SINISA.MYD
08/03/2004  14:52             1.024 SINISA.MYI

3- Create an index:

mysql> alter table SINISA add index SINISADX (NAME);

4- The case was changed to lower case:

08/03/2004  14:57    <DIR>          .
08/03/2004  14:57    <DIR>          ..
08/03/2004  14:57             8.574 sinisa.frm
08/03/2004  14:57                 0 sinisa.MYD
08/03/2004  14:57             1.024 sinisa.MYI

mysql> show create table SINISA\G
*************************** 1. row ***************************
       Table: SINISA
Create Table: CREATE TABLE `SINISA` (
  `ID` int(11) default NULL,
  `NAME` char(20) default NULL,
  KEY `SINISADX` (`NAME`)
) TYPE=MyISAM
1 row in set (0.86 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| sinisa         |
+----------------+
[29 Mar 2004 6:06] Parwinder Sekhon
Just voted for this.  I work on a persistence layer that relies on getting meta-data, and this is case-sensitive.  It relies on using foreign keys, and to use foreign keys we have to add indexes, hence the effect on case of table names.
[30 Mar 2004 10:28] Parwinder Sekhon
Actually this is not just a problem with ALTER TABLE ADD INDEX, it seems like it is a problem with ALTER TABLE. I get the ALTER TABLE ADD COLUMN.
[23 Jun 2004 8:51] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fix will be in 4.0.21 and 4.1.3.