Table Names Not Case Matched

Bug #674145 reported by m00dawg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Medium
Andrew Hutchings
7.0
Fix Released
Medium
Andrew Hutchings

Bug Description

While Database names in Drizzle are case-aware, Table-Names are being displayed only in lowercase:

drizzle> create database Test;
Query OK, 1 row affected (0.04 sec)

drizzle> use test;
Database changed
drizzle> show databases;
+--------------------+
| Database |
+--------------------+
| DATA_DICTIONARY |
| INFORMATION_SCHEMA |
| mcptest |
| Test |
+--------------------+
4 rows in set (0 sec)

drizzle> SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='mcptest' ORDER BY TABLE_NAME LIMIT 5;
+--------------+
| TABLE_NAME |
+--------------+
| art |
| blogcomments |
| blogmoods |
| blogposts |
| blogtags |
+--------------+
5 rows in set (0 sec)

drizzle> SELECT TABLE_NAME FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='mcptest' ORDER BY TABLE_NAME LIMIT 5;
+--------------+
| TABLE_NAME |
+--------------+
| art |
| blogcomments |
| blogmoods |
| blogposts |
| blogtags |
+--------------+
5 rows in set (0.15 sec)

drizzle> use mcptest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

drizzle> SHOW CREATE TABLE ShoutBox\G
*************************** 1. row ***************************
      Table: shoutbox
Create Table: CREATE TABLE `shoutbox` (
 `shoutid` INT NOT NULL AUTO_INCREMENT,
 `date` DATETIME DEFAULT NULL,
 `shoutname` TEXT COLLATE utf8_general_ci NOT NULL,
 `shout` TEXT COLLATE utf8_general_ci NOT NULL,
 PRIMARY KEY (`shoutid`),
 KEY `date_idx` (`date`)
) ENGINE=InnoDB COLLATE = utf8_general_ci AUTO_INCREMENT=267
1 row in set (0 sec)

drizzle> SHOW CREATE TABLE SHOUTBOX\G
*************************** 1. row ***************************
      Table: shoutbox
Create Table: CREATE TABLE `shoutbox` (
 `shoutid` INT NOT NULL AUTO_INCREMENT,
 `date` DATETIME DEFAULT NULL,
 `shoutname` TEXT COLLATE utf8_general_ci NOT NULL,
 `shout` TEXT COLLATE utf8_general_ci NOT NULL,
 PRIMARY KEY (`shoutid`),
 KEY `date_idx` (`date`)
) ENGINE=InnoDB COLLATE = utf8_general_ci AUTO_INCREMENT=267
1 row in set (0 sec)

What things look like in MySQL:

mysql> SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='mcptest' LIMIT 5;
+---------------+
| TABLE_NAME |
+---------------+
| Art |
| BlogComments |
| BlogMoods |
| BlogPosts |
| BlogPostsView |
+---------------+
5 rows in set (0.01 sec)

mysql> SHOW CREATE TABLE ShoutBox\G
*************************** 1. row ***************************
      Table: ShoutBox
Create Table: CREATE TABLE `ShoutBox` (
 `shoutid` int(11) NOT NULL AUTO_INCREMENT,
 `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `shoutname` tinytext NOT NULL,
 `shout` tinytext NOT NULL,
 PRIMARY KEY (`shoutid`),
 KEY `date_idx` (`date`)
) ENGINE=InnoDB AUTO_INCREMENT=267 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

Drizzle should be preserving the original case (whether or not Drizzle is case sensitive).

Related branches

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

The current branch turns on case sensitivity which causes FS based issues, going to take a different approach.

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

lp:~linuxjedi/drizzle/trunk-bug-674145-take3 is the real fix.

Note that after this fix is applied any tables that already exist will remain lower case as they were converted to lower case upon creation.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.