MySQL: lowercase on FOREIGN KEY issue

  • estebanplatz
  • Born
  • Born
  • estebanplatz
  • Posts: 1

Post 3+ Months Ago

Hi Folks,

The problem appears on MySQL (Server version 5.1.29-rc-community) mounted on Windows server.
When I create a database backup script where the foreign keys statements appears in lowercase even if mentioned foreign key was created in camel format

I created the table using the following statement. Pay attention on REFERENCES

Code: [ Select ]
CREATE TABLE `User` (
`UserID` int(11) NOT NULL auto_increment,
`CustomerID` int(11) NOT NULL,
`Type` tinyint(4) default NULL,
`FirstName` varchar(64) default NULL,
`LastName` varchar(64) default NULL,
PRIMARY KEY (`UserID`),
KEY `fkUserCustomerCustomerID` (`CustomerID`),
CONSTRAINT `fkUserCustomerCustomerID` FOREIGN KEY (`CustomerID`) REFERENCES `Customer` (`CustomerID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8
  1. CREATE TABLE `User` (
  2. `UserID` int(11) NOT NULL auto_increment,
  3. `CustomerID` int(11) NOT NULL,
  4. `Type` tinyint(4) default NULL,
  5. `FirstName` varchar(64) default NULL,
  6. `LastName` varchar(64) default NULL,
  7. PRIMARY KEY (`UserID`),
  8. KEY `fkUserCustomerCustomerID` (`CustomerID`),
  9. CONSTRAINT `fkUserCustomerCustomerID` FOREIGN KEY (`CustomerID`) REFERENCES `Customer` (`CustomerID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8


When I request the table structure, the following statement appears:

Code: [ Select ]
SHOW CREATE TABLE User
CREATE TABLE `User` (
`UserID` int(11) NOT NULL AUTO_INCREMENT,
`CustomerID` int(11) NOT NULL,
`Type` tinyint(4) DEFAULT NULL,
`FirstName` varchar(64) DEFAULT NULL,
`LastName` varchar(64) DEFAULT NULL,
PRIMARY KEY (`UserID`),
KEY `fkUserCustomerCustomerID` (`CustomerID`),
CONSTRAINT `fkUserCustomerCustomerID` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
  1. SHOW CREATE TABLE User
  2. CREATE TABLE `User` (
  3. `UserID` int(11) NOT NULL AUTO_INCREMENT,
  4. `CustomerID` int(11) NOT NULL,
  5. `Type` tinyint(4) DEFAULT NULL,
  6. `FirstName` varchar(64) DEFAULT NULL,
  7. `LastName` varchar(64) DEFAULT NULL,
  8. PRIMARY KEY (`UserID`),
  9. KEY `fkUserCustomerCustomerID` (`CustomerID`),
  10. CONSTRAINT `fkUserCustomerCustomerID` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  11. ) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;


Can everyone help me to address this problem?
Thanks in advance
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1893
  • Loc: Las Vegas

Post 3+ Months Ago

Database names in mysql correspond to directory names on the disk. Since windows filesystems are not case sensitive, neither are the database names in mysql.

Here's a better description: http://dev.mysql.com/doc/refman/5.0/en/ ... ivity.html

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 49 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.