Table name case is not preserved on export

Olaf789's profile image Olaf789 posted 13 years ago in Import/Export Permalink
Heidi works very well most of the time. Unfortunately I discovered a small problem with the sql export. When the server runs on windows and lower_case_table_names=2, the server preserves the case of table and database names. When exporting there is a small glitch in the sql file: it looses the case for the create statement as shown is this example:

# --------------------------------------------------------
# Host: 127.0.0.1
# Server version: 5.1.41
# Server OS: Win32
# HeidiSQL version: 6.0.0.3603
# Date/time: 2010-12-28 08:49:40
# --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

# Dumping database structure for Docu_6300
DROP DATABASE IF EXISTS `Docu_6300`;
CREATE DATABASE IF NOT EXISTS `docu_6300` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci */;
USE `Docu_6300`;


# Dumping structure for table Docu_6300.AllowedVersions
DROP TABLE IF EXISTS `AllowedVersions`;
CREATE TABLE IF NOT EXISTS `AllowedVersions` (
`ID` int(11) NOT NULL AUTO_INCREMENT,

As you can see, everything works fine EXCEPT the create database statement.

By the way: don't feel too bad about this because mysqldump fails as well
ansgar's profile image ansgar posted 13 years ago Permalink
The wrong thing is here that
SHOW CREATE DATABASE Docu_6300
provides a lower case db name in such cases. See MySQL bug #21317.
Olaf789's profile image Olaf789 posted 13 years ago Permalink
Thanks for the explanation smile.

I noticed that the MySQL bug was reported was reported in 2006unhappy. I'll see if I can write an SQL macro that works around this.

Please login to leave a reply, or register at first.