Bug #5628 German characters in field-defs will be '?' with some table-definitions
Submitted: 17 Sep 2004 12:10 Modified: 24 Sep 2004 8:15
Reporter: Carsten Seidel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.4-gamma-nt OS:Windows (Win 2k)
Assigned to: Alexander Barkov CPU Architecture:Any

[17 Sep 2004 12:10] Carsten Seidel
Description:
German characters will be written as '?', when definition come after integer-field with default 0 (or any other value which is not null).
This is serious, because a dump will not work to restore.

CREATE TABLE `test_a` (
  `field_a` TINYINT(1) UNSIGNED DEFAULT 0,
  `field_b` ENUM('value','öäü_value') NOT NULL DEFAULT 'öäü_value'
) TYPE=InnoDB;
show create table test_a;

shows: 
"CREATE TABLE `test_a` (
  `field_a` tinyint(1) unsigned default '0',
  `field_b` enum('value','???_value') collate latin1_german2_ci NOT NULL default 'öäü_value'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci"

which is bad, *but:*

CREATE TABLE `test_b` (
  `field_a` TINYINT(1) UNSIGNED DEFAULT null,
  `field_b` ENUM('value','öäü_value') NOT NULL DEFAULT 'öäü_value'
) TYPE=InnoDB;
show create table test_b;

shows:
"CREATE TABLE `test_b` (
  `field_a` tinyint(1) unsigned default NULL,
  `field_b` enum('value','öäü_value') collate latin1_german2_ci NOT NULL default 'öäü_value'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci"

which is ok.

How to repeat:
My server hat default-charset latin1 and collation latin1_german2_ci as default.
Use the above skript.
[17 Sep 2004 14:42] MySQL Verification Team
Verified on Linux BK source.
[24 Sep 2004 8:15] 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