Bug #40805 Cannot restore table
Submitted: 17 Nov 2008 21:07 Modified: 29 Jan 2009 20:58
Reporter: Mikulas Kovarcik Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Charsets Severity:S1 (Critical)
Version:6.0 bzr OS:Any (Linux, MS Windows)
Assigned to: Alexander Barkov CPU Architecture:Any
Tags: Backup, regression, restore

[17 Nov 2008 21:07] Mikulas Kovarcik
Description:
I made backup file with MySQL Administrator and then I tried made restore. But execution stopped on table players in my database. I can give to you this backup. Backups were made from version 5.2 and 6.0.7. and restore was made into version 6.0.x.

How to repeat:
Run this backup:

-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	6.0.7-alpha-community-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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' */;

--
-- Create schema sokolzbyslavi
--

CREATE DATABASE IF NOT EXISTS sokolzbyslavi;
USE sokolzbyslavi;

--
-- Definition of table `players`
--

DROP TABLE IF EXISTS `players`;
CREATE TABLE `players` (
  `ID` smallint(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
  `Aktiv` enum('A','F','N','S','X') COLLATE latin2_general_ci DEFAULT NULL,
  `Prijm` char(20) CHARACTER SET latin2 DEFAULT NULL,
  `Jmeno` char(15) CHARACTER SET latin2 DEFAULT NULL,
  `DatN` date NOT NULL DEFAULT '0000-00-00',
  `Post` enum('','B','O','Z','U') COLLATE latin2_general_ci DEFAULT NULL,
  `MU` smallint(3) NOT NULL DEFAULT '0',
  `MB` smallint(3) NOT NULL DEFAULT '0',
  `OU` smallint(3) NOT NULL DEFAULT '0',
  `OB` smallint(3) NOT NULL DEFAULT '0',
  `Dat1` date NOT NULL DEFAULT '0000-00-00',
  `Zap1` smallint(3) unsigned NOT NULL DEFAULT '0',
  `DatP` date NOT NULL DEFAULT '0000-00-00',
  `ZapP` smallint(3) unsigned NOT NULL DEFAULT '0',
  `Foto` char(25) CHARACTER SET latin2 DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin2 COLLATE=latin2_general_ci;

--
-- Dumping data for table `players`
--

/*!40000 ALTER TABLE `players` DISABLE KEYS */;
INSERT INTO `players` (`ID`,`Aktiv`,`Prijm`,`Jmeno`,`DatN`,`Post`,`MU`,`MB`,`OU`,`OB`,`Dat1`,`Zap1`,`DatP`,`ZapP`,`Foto`) VALUES
 (00001,'A','Kovařčík','Mikuláš','1977-05-27','B',335,0,53,0,'1994-04-29',6,'2008-11-02',43,'kovarcik_m.jpg');
/*!40000 ALTER TABLE `players` ENABLE KEYS */;
[18 Nov 2008 19:56] Mikulas Kovarcik
complete backup

Attachment: Sokol 20081117 2043.zip (application/zip, text), 184.70 KiB.

[19 Nov 2008 8:26] Sveta Smirnova
Thank you for the report.

Please indicate accurate version of MySQL Administrator you use, error from MySQL server and its configuration file.
[19 Nov 2008 16:37] Mikulas Kovarcik
MySQL Administrator 1.2.14 - latest, but it appeared in former versions also.
[19 Nov 2008 16:41] Mikulas Kovarcik
I am not able to send you an error msg. bcs. I must kill process mysqld every time. Processor occupancy is 100%, and mysqld takes 99%. It looks like neverending loop.
[21 Nov 2008 8:54] Sveta Smirnova
Thank you for the feedback.

Problem is players table.

Simplified test case:

DROP TABLE IF EXISTS `players`;
CREATE TABLE `players` (
  `ID` smallint(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
  `Post` enum('','B','O','Z','U') COLLATE latin2_czech_cs DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=135 DEFAULT CHARSET=latin2;

INSERT INTO `players` (`ID`,`Post`) VALUES (00041,'');

Workaround: don't use collation latin2_czech_cs for column Post.
[21 Nov 2008 8:55] Sveta Smirnova
Bug description: INSERT into ENUM with collation latin2_czech_cs hangs.
[21 Nov 2008 9:15] Sveta Smirnova
Bug is not repeatable with with versions 4.1, 5.0, 5.1
[28 Nov 2008 12:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/60155

2752 Alexander Barkov	2008-11-28
      Bug#40805 Cannot restore table
      Problem: my_strnncoll_czech() hung when comparing
      two empty strings.
      Fix:
      - Wrong piece of code in cype-czech.c:NEXT_CMP_VALUE was fixed.
      - Related comment was added into ctype-czech.c.
      - Test case was added.
[24 Dec 2008 7:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/62284

2822 Alexander Barkov	2008-12-24
      Bug#40805 Cannot restore table
      Problem: my_strnncoll_czech() hung when comparing
        two empty strings.
      Fix:
      - Wrong piece of code in cype-czech.c:NEXT_CMP_VALUE was fixed.
      - Related comment was added into ctype-czech.c.
      - Test case was added.
      
      The fix does not change the collation order,
      index rebuild is not needed when upgrade.
[24 Dec 2008 8:01] Alexander Barkov
Pushed into 6.0.9-bugteam
[20 Jan 2009 19:00] Bugs System
Pushed into 6.0.10-alpha (revid:joro@sun.com-20090119171328-2hemf2ndc1dxl0et) (version source revid:azundris@mysql.com-20081230114916-c290n83z25wkt6e4) (merge vers: 6.0.9-alpha) (pib:6)
[29 Jan 2009 20:58] Paul DuBois
Noted in 6.0.10 changelog.

Comparison of empty strings for the latin2_czech_cs character set
could hang.