Bug #5728 'int not null' make next enum (using cp1251) corrupted in mysqldump output
Submitted: 24 Sep 2004 9:56 Modified: 27 Oct 2004 3:21
Reporter: Egor Egorov Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.3-4.1.5 OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[24 Sep 2004 9:56] Egor Egorov
Description:
> Using 'int not null' make next enum (using cp1251) corrupted in
> mysqldump output on W2000.

How to repeat:
Note: replace entities by their values, because the post in web form at bugs.mysql.com converted cyrillic letters into entities. :)

drop table if exists t1;
drop table if exists t2;
create table t1 (a int, b enum('А','Б')) DEFAULT CHARACTER SET cp1251;
create table t2 (a int not null, b enum('А','Б')) DEFAULT CHARACTER SET cp1251;

show fields from t1 like 'b';
show fields from t2 like 'b';
+---+---------------+-----+--+------+--+
| b | enum('А','Б') | YES |  | NULL |  |
+---+---------------+-----+--+------+--+
| b | enum('&#1040;','&#1041;') | YES |  | NULL |  |   <------ Ok
+---+---------------+-----+--+------+--+

show create table t1;
show create table t2;
+----+--------------------------------
| t1 | CREATE TABLE `t1` (
  `a` int(11) default NULL,
  `b` enum('&#1040;','&#1041;') default NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
+----+--------------------------------
+----+--------------------------------
| t2 | CREATE TABLE `t2` (
  `a` int(11) NOT NULL default '0',
  `b` enum('?','?') default NULL           <------ Oops!
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
[27 Oct 2004 3:21] MySQL Verification Team
I wasn't able to repeat the behavior reported testing 4.1.3b/4.1.5/4.1.6.

Below the output of mysqldump 4.1.3 of the table offended:

--
-- Table structure for table `t2`
--

DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
  `a` int(11) NOT NULL default '0',
  `b` enum('&#1040;','&#1041;') default NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;

--
-- Dumping data for table `t2`
--

mysql> show create table t2;
+-------+--------------------------------------------
--------------------------+
| Table | Create Table
                          |
+-------+--------------------------------------------
--------------------------+
| t2    | CREATE TABLE `t2` (
  `a` int(11) NOT NULL default '0',
  `b` enum('&#1040;','&#1041;') default NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 |
+-------+--------------------------------------------
--------------------------+
1 row in set (0.01 sec)