Bug #6165 mysqldump + enum + default + umlaut
Submitted: 19 Oct 2004 20:26 Modified: 2 Dec 2004 8:55
Reporter: Miguel Solorzano Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:4.1.7 BK source OS:Linux (Linux)
Assigned to: Alexander Barkov CPU Architecture:Any

[19 Oct 2004 20:26] Miguel Solorzano
Description:
I am trying to back up a database that has a field definition like i.e.

foo enum('a','b','ö') default 'ö'

and mysqldump does not correctly encode the umlauts in it. Depending on
the charset I set I get either lots of '?' instead of the umlauts or if
I specify utf8 for the charset I will get the correct umlauts in the
enum values but not in the default value!

I am using 4.1.2-alpha-standard and I couldn't see a bug fix for this
in the recent version history.

I already lost a whole day recovering a deleted database because of this.
It seems that there is no easy way to edit such a dump without destroying
the encoding and I ended up with a database that had many fields empty
because the database values didn't match the enum definition.

Any help appreciated,
Andreas Pardeike

How to repeat:
create table t0 (id int not null auto_increment primary key,
foo enum('a','b','ö') default 'ö');

insert into t0 values ('','a'),('','b'),('','ö');

--do a dump you should see:

/*!40000 ALTER TABLE `t0` DISABLE KEYS */;
LOCK TABLES `t0` WRITE;
INSERT INTO `t0` VALUES (1,'a'),(2,'b'),(3,'ö'),(4,'a'),(5,'b'),(6,'ö');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t0` ENABLE KEYS */;
[19 Oct 2004 22:26] MySQL Verification Team
duplicate of:

http://bugs.mysql.com/bug.php?id=5693
[20 Oct 2004 8:31] Sergei Golubchik
Miguel, did you indeed verifiy it for 4.1.7 ?
[20 Oct 2004 13:40] MySQL Verification Team
Sergei,

miguel@hegel:~/dbs/4.1$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.7-gamma-debug-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

and received an e-mail from the user saying he already opened
a bug report.
[21 Oct 2004 14:02] Alexander Barkov
latin1 inserts

Attachment: bug.sql (application/octet-stream, text), 190 bytes.

[21 Oct 2004 14:04] Alexander Barkov
Miguel, I uploaded bug.sql info files section of the bug report.
Can you please run it:

mysql test  < bug.sql

Then dump it:

mysqldump test t0 > res.sql

and then upload the result. I'll check if you get the same with me.
Thank you.

I cannot reproduce the problem on my box :(
[21 Oct 2004 19:00] MySQL Verification Team
hi Bar,

Done. Below the dump output:

/*!40000 ALTER TABLE `t0` DISABLE KEYS */;
LOCK TABLES `t0` WRITE;
INSERT INTO `t0` VALUES (1,'a'),(2,'b'),(3,'ö');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t0` ENABLE KEYS */;
[2 Dec 2004 8:55] Alexander Barkov
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:

Fixed together with Bug#6379 ENUM values are incorrectly converted
in 4.1.8